Hello, dear community!
I’ve met an issue related to mutable borrowing with pointing lifetimes. I have a structure that has a field contains a vector of references. The references live same time as an instance of the structure; it references on values from a vector from the same instance.
I’ve decided to separate a synchronization of references and values to a method; I get an error says me that the instance does not live not enough. And it happens only when I point lifetime and mutable borrowing. But without them I can’t make a reference on data from the instance.
How can I use a method borrows a mutable reference inside a method that should return a newly created instance?
https://play.rust-lang.org/?gist=9b1637146422d688fbadf738e6d44df7&version=stable it is code sample for clearance.
Thanks. Sorry if my English is not clear.