Skip to content

Commit

Permalink
add conversion from &Vec
Browse files Browse the repository at this point in the history
  • Loading branch information
carlsverre committed Dec 4, 2024
1 parent 009ec28 commit 061ff87
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 @@ -27,6 +27,12 @@ impl From<&[u8]> for Slice {
}
}

impl From<&Vec<u8>> for Slice {
fn from(value: &Vec<u8>) -> Self {
Self::from(value.as_slice())
}
}

impl From<&str> for Slice {
fn from(value: &str) -> Self {
Self::from(value.as_bytes())
Expand Down

0 comments on commit 061ff87

Please sign in to comment.