From 061ff872b653738e866284abf164c7596095a657 Mon Sep 17 00:00:00 2001 From: Carl Sverre <82591+carlsverre@users.noreply.github.com> Date: Tue, 3 Dec 2024 16:31:07 -0800 Subject: [PATCH] add conversion from &Vec --- src/slice.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/slice.rs b/src/slice.rs index e466cca..d38b454 100644 --- a/src/slice.rs +++ b/src/slice.rs @@ -27,6 +27,12 @@ impl From<&[u8]> for Slice { } } +impl From<&Vec> for Slice { + fn from(value: &Vec) -> Self { + Self::from(value.as_slice()) + } +} + impl From<&str> for Slice { fn from(value: &str) -> Self { Self::from(value.as_bytes())