Open sosthene-nitrokey opened 3 months ago
I checked with nightly, we can't do that with just a type Buffer<T>: Unsize<[T]
, because there is no implementation of Unsize<[T]>
for [T]
, that's a shame. So even if Unsize
gets stabilized, we'll have to keep all the manual conversion methods.
This makes
drain
usable in the context of an implementation generic over the storage This also makes it possible to get a*View
in this same contextThis could also be a way to "de-monomorphize" all the implementations of the
Inner
structs:We could make all implementation define an inner function that is over a
View
type, and start the implementation withthis = self.as_(mut_)view
, maybe for binary size and compilation time benefits. For example the implementation ofVecInner::push
could be: