Closed danakj closed 10 months ago
Actually, I don't think we should add this one.
Using into()
to make a reference feels wrong without a borrow checker, as it's hiding the reference taking, and looks like a conversion to another value (which it is, but it's holding a reference).
https://doc.rust-lang.org/stable/std/option/enum.Option.html#impl-From%3C%26'a+Option%3CT%3E%3E-for-Option%3C%26'a+T%3E
Option should support construction of an Option<T&> from an Option.
This is what
as_ref()
does, but supports going throughinto()