Skip to content

Commit f22eaf4

Browse files
committed
added conversion from array ref to slice
1 parent 061ff87 commit f22eaf4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/slice.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ impl<const N: usize> From<[u8; N]> for Slice {
5757
}
5858
}
5959

60+
impl<const N: usize> From<&[u8; N]> for Slice {
61+
fn from(value: &[u8; N]) -> Self {
62+
Self::from(value.as_slice())
63+
}
64+
}
65+
6066
impl FromIterator<u8> for Slice {
6167
fn from_iter<T>(iter: T) -> Self
6268
where

0 commit comments

Comments
 (0)