From c2fd5cefa4714effe51ae052faa4ef132aa526ec Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Wed, 13 Jan 2021 09:57:09 +1100 Subject: [PATCH] Remove `visit_bytes` implementation from `FromStrVisitor` This visitor is meant to deserialize strings using `FromStr` not bytes. --- src/serde_util.rs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/serde_util.rs b/src/serde_util.rs index 313821a..bc815bc 100644 --- a/src/serde_util.rs +++ b/src/serde_util.rs @@ -29,14 +29,6 @@ where formatter.write_str(self.expectation) } - fn visit_bytes(self, v: &[u8]) -> Result { - if let Ok(hex) = str::from_utf8(v) { - FromStr::from_str(hex).map_err(E::custom) - } else { - Err(E::invalid_value(de::Unexpected::Bytes(v), &self)) - } - } - fn visit_str(self, v: &str) -> Result { FromStr::from_str(v).map_err(E::custom) }