Closed
Description
In GJ I have this trait like this:
pub trait AsyncRead: 'static {
fn try_read<T>(self, buf: T, min_bytes: usize) -> Promise<(Self, T, usize), Error<(Self, T)>> where T: DerefMut<Target=[u8]>, Self: Sized;
}
I'd like to switch the bound on T
to be T: AsMut<[u8]>
, but then I can no longer use a bare Vec<u8>
for T
, because there is currently no impl<T> AsMut<[T]> for Vec<T>
.
It seems to me that such an impl ought to exist, especially because impl<T> AsRef<[T]> for Vec<T>
already exists.
Metadata
Metadata
Assignees
Labels
No labels