I'm trying to access a member of a struct while another member, a Vector, is being traversed and mutated using the
for_each function. I've got the following error -
cannot borrow self as immutable because it is also borrowed as mutable
and am not able to figure out a work around. Here's my simplified source code - Rust Playground.
The relevant code is at line 23.
I know for sure that I am not going to mutate the
value member of the struct instance when trying to traverse through
vector. Is there a way of letting the compiler know this so I can immutably access
Any help would be much appreciated!