From f22eaf4d0b83b9a62e64e52ec768425870e241bc Mon Sep 17 00:00:00 2001 From: Carl Sverre <82591+carlsverre@users.noreply.github.com> Date: Tue, 3 Dec 2024 16:37:36 -0800 Subject: [PATCH] added conversion from array ref to slice --- src/slice.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/slice.rs b/src/slice.rs index d38b454..5d2ed09 100644 --- a/src/slice.rs +++ b/src/slice.rs @@ -57,6 +57,12 @@ impl From<[u8; N]> for Slice { } } +impl From<&[u8; N]> for Slice { + fn from(value: &[u8; N]) -> Self { + Self::from(value.as_slice()) + } +} + impl FromIterator for Slice { fn from_iter(iter: T) -> Self where