Modifications to serde

This commit is contained in:
Kirk Baird
2019-03-22 16:10:43 +11:00
5 changed files with 62 additions and 23 deletions

View File

@@ -15,6 +15,7 @@ impl<'de> Visitor<'de> for HexVisitor {
where
E: de::Error,
{
Ok(hex::decode(value.trim_start_matches("0x")).map_err(|e| de::Error::custom(format!("invalid hex ({:?})", e)))?)
Ok(hex::decode(value.trim_start_matches("0x"))
.map_err(|e| de::Error::custom(format!("invalid hex ({:?})", e)))?)
}
}