From a11cb4017752e3e257a047dbf2128780cda2924b Mon Sep 17 00:00:00 2001 From: Ryan Daum Date: Mon, 10 Feb 2025 14:21:45 -0500 Subject: [PATCH] Provide From for Slice construction Analogous to From for slice_bytes.rs, to allow for zero-copy operations with existing ByteViews. https://github.com/fjall-rs/value-log/issues/19 --- src/slice/slice_default.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/slice/slice_default.rs b/src/slice/slice_default.rs index 1b3911d..b4620c1 100644 --- a/src/slice/slice_default.rs +++ b/src/slice/slice_default.rs @@ -56,3 +56,9 @@ impl From for Slice { Self(ByteView::from(value.into_bytes())) } } + +impl From for Slice { + fn from(value: ByteView) -> Self { + Self(value) + } +}