This PR rebrands MyTrait<'a> as IntoOwned<'a>, an analogue of ToOwned that is more GAT-friendly. GATs can implement IntoOwned<'_> and support the re-borrowing of the owned type back into the GAT. The existing ToOwned infrastructure relies instead on Rust's Borrow, which can only borrow into a reference to a Borrowed type.
The PR also streamlines MyTrait, removing comparison functionality from it. The inequalities were unused, and the equality method can be locally implemented using borrow_as, as our implementors all support co-variant PartialOrd implementations.
Some other light changes around removing the push functionality for BatchContainer preceded this work (pointed out that the remaining complexity was MyTrait), but I think we agree that these changes are good too.
Only known regression is in rhh.rs, where previously we supported a non-allocating hash evaluation, but now call into_owned(). We can shake that out once things are more stable and rhh is actually expected to work.
This PR rebrands
MyTrait<'a>
asIntoOwned<'a>
, an analogue ofToOwned
that is more GAT-friendly. GATs can implementIntoOwned<'_>
and support the re-borrowing of the owned type back into the GAT. The existingToOwned
infrastructure relies instead on Rust'sBorrow
, which can only borrow into a reference to aBorrowed
type.The PR also streamlines
MyTrait
, removing comparison functionality from it. The inequalities were unused, and the equality method can be locally implemented usingborrow_as
, as our implementors all support co-variantPartialOrd
implementations.Some other light changes around removing the
push
functionality forBatchContainer
preceded this work (pointed out that the remaining complexity wasMyTrait
), but I think we agree that these changes are good too.Only known regression is in
rhh.rs
, where previously we supported a non-allocating hash evaluation, but now callinto_owned()
. We can shake that out once things are more stable andrhh
is actually expected to work.