Skip to content

Commit

Permalink
added conversion from array ref to slice
Browse files Browse the repository at this point in the history
  • Loading branch information
carlsverre committed Dec 4, 2024
1 parent 061ff87 commit f22eaf4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ impl<const N: usize> From<[u8; N]> for Slice {
}
}

impl<const N: usize> From<&[u8; N]> for Slice {
fn from(value: &[u8; N]) -> Self {
Self::from(value.as_slice())
}
}

impl FromIterator<u8> for Slice {
fn from_iter<T>(iter: T) -> Self
where
Expand Down

0 comments on commit f22eaf4

Please sign in to comment.