refactor: allow any &[u8] to be convertible to Blob
This allows Vec<u8> or &[u8; 123] to convert _into_ Blob now, while
previously it wasnt possible.
@@ -20,9 +20,9 @@ impl Blob {
}
}
-impl From<&[u8]> for Blob {
- fn from(a: &[u8]) -> Blob {
- Blob(a.to_vec())
+impl<T: AsRef<[u8]>> From<T> for Blob {
+ fn from(a: T) -> Blob {
+ Blob(a.as_ref().to_vec())
}
}
