Better Blanket implementation of ByteEncoder Into<String>

This commit is contained in:
Jeremy Wall 2022-08-02 01:53:34 -04:00
parent ce3fd62f52
commit b8f3d9c630

View File

@ -46,11 +46,11 @@ where
}
}
impl<S> ByteEncoder for S
impl<V> ByteEncoder for V
where
S: ToString,
V: Into<Vec<u8>> + Clone,
{
fn bytes(&self) -> Vec<u8> {
self.to_string().into_bytes()
<Self as Into<Vec<u8>>>::into(self.clone())
}
}