diff --git a/src/bytes.rs b/src/bytes.rs index 0b443c85b..55847707c 100644 --- a/src/bytes.rs +++ b/src/bytes.rs @@ -821,6 +821,12 @@ impl From<&'static [u8]> for Bytes { } } +impl From<&[u8; N]> for Bytes { + fn from(slice: &[u8; N]) -> Self { + Bytes::copy_from_slice(slice) + } +} + impl From<&'static str> for Bytes { fn from(slice: &'static str) -> Bytes { Bytes::from_static(slice.as_bytes())