Skip to content

Commit c2fd5ce

Browse files
Remove visit_bytes implementation from FromStrVisitor
This visitor is meant to deserialize strings using `FromStr` not bytes.
1 parent e6e23e9 commit c2fd5ce

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

src/serde_util.rs

-8
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,6 @@ where
2929
formatter.write_str(self.expectation)
3030
}
3131

32-
fn visit_bytes<E: de::Error>(self, v: &[u8]) -> Result<Self::Value, E> {
33-
if let Ok(hex) = str::from_utf8(v) {
34-
FromStr::from_str(hex).map_err(E::custom)
35-
} else {
36-
Err(E::invalid_value(de::Unexpected::Bytes(v), &self))
37-
}
38-
}
39-
4032
fn visit_str<E: de::Error>(self, v: &str) -> Result<Self::Value, E> {
4133
FromStr::from_str(v).map_err(E::custom)
4234
}

0 commit comments

Comments
 (0)