So I'm having trouble understanding why the fn on the
&'a mut impl fails to compile, while the one on the
&'a impl is fine: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=bdad95e5ab1ba448eeb61fd93222f34d
Is there something going on with auto-(de)ref that I'm not realizing here?
I believe this occurs because
&mut T is not
Really what you end up with is a reborrow in the impl for
&mut str (
&*self.val), which makes it clearer why this error says what it says.
Ok. I had considered reborrowing but forgotten about the
Copy behavior. That makes so much more sense. Thank you!