Hello, much appreciate for the help and time.
I am new to Rust, and trying to create a simple program to get me up and running with Rust
I tried to store structs to a hashmap and then later modify them through a method
here is the code I am playing around
if I change line 'from &mut self
to &'a mut self
the lifetime problem disappears, but I couldn't println!
later, and another problem arises: could not borrow immutable because there is a mutable borrow
though I added the <'a>
to the structs and methods, I don't quite understand how the contracts will be read...
how do we modify the lists with making the "permanent" borrow by &'a mut self
?
thank you friends!