Implement ToString for public sodium types
@@ -267,6 +267,12 @@ macro_rules! implement_public_sodium_wrapper {
}
}
+ impl ToString for $name {
+ fn to_string(&self) -> String {
+ ::crypto::HexValue::to_hex(self)
+ }
+ }
+
impl fmt::Debug for $name {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, stringify!($name))?;
