I’m struggling with a problem, glad if someone explain it to me.
So, playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=d06fcdc5d812895fd068176090288f1b
As you can see, code doesn’t compile, and complains about double mutable borrowing, though it’s clear that borrow on line 17 must be released on line 21? Why so? I understand that if I return something, it will block another borrow, for the lifetime of “something”, but I don’t understand why compiler doesn’t take in account “block” structure.