mirror of
https://github.com/zaphar/merkle-dag.git
synced 2025-07-22 10:39:48 -04:00
Better Blanket implementation of ByteEncoder Into<String>
This commit is contained in:
parent
ce3fd62f52
commit
b8f3d9c630
@ -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())
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user