File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -27,12 +27,24 @@ impl From<&[u8]> for Slice {
27
27
}
28
28
}
29
29
30
+ impl From < & Vec < u8 > > for Slice {
31
+ fn from ( value : & Vec < u8 > ) -> Self {
32
+ Self :: from ( value. as_slice ( ) )
33
+ }
34
+ }
35
+
30
36
impl From < & str > for Slice {
31
37
fn from ( value : & str ) -> Self {
32
38
Self :: from ( value. as_bytes ( ) )
33
39
}
34
40
}
35
41
42
+ impl From < & String > for Slice {
43
+ fn from ( value : & String ) -> Self {
44
+ Self :: from ( value. as_str ( ) )
45
+ }
46
+ }
47
+
36
48
impl From < Arc < str > > for Slice {
37
49
fn from ( value : Arc < str > ) -> Self {
38
50
Self :: from ( & * value)
@@ -45,6 +57,12 @@ impl<const N: usize> From<[u8; N]> for Slice {
45
57
}
46
58
}
47
59
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
+
48
66
impl FromIterator < u8 > for Slice {
49
67
fn from_iter < T > ( iter : T ) -> Self
50
68
where
You can’t perform that action at this time.
0 commit comments