Add Bytes AsRef.

This commit is contained in:
Alejandro Cabeza Romero 2026-05-04 14:59:33 +02:00
parent 622c6a8c39
commit 3ae7ff2258
No known key found for this signature in database
GPG Key ID: DA3D14AE478030FD

View File

@ -18,6 +18,12 @@ impl Bytes {
}
}
impl AsRef<[u8]> for Bytes {
fn as_ref(&self) -> &[u8] {
self.as_slice()
}
}
impl From<Vec<u8>> for Bytes {
fn from(value: Vec<u8>) -> Self {
Self(value)