I once had an issue implementing a Scalar Value String in Rust, where its index operator should return a non-borrow type (the string type itself, not something like &str
).
Currently we've only std::ops::Index
and std::ops::IndexMut
, both of which output &Output
. Is it trivial for Rust to support something like std::ops::NonRefIndex
?