From e362c5e1fe9ece2cea8fe59dd88a0edb7e5bb48e Mon Sep 17 00:00:00 2001 From: Mathias Koch Date: Wed, 20 May 2020 13:11:53 +0200 Subject: [PATCH 1/2] Correctly handle whitespaces before sequence start --- src/de/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de/mod.rs b/src/de/mod.rs index c838c881a..000a7f86a 100644 --- a/src/de/mod.rs +++ b/src/de/mod.rs @@ -499,7 +499,7 @@ impl<'a, 'de> de::Deserializer<'de> for &'a mut Deserializer<'de> { where V: Visitor<'de>, { - match self.peek().ok_or(Error::EofWhileParsingValue)? { + match self.parse_whitespace().ok_or(Error::EofWhileParsingValue)? { b'[' => { self.eat_char(); let ret = visitor.visit_seq(SeqAccess::new(self))?; From 2cbfb20c5125fba10e5e828d4d66ec4c0d8bf4bd Mon Sep 17 00:00:00 2001 From: Mathias Koch Date: Wed, 20 May 2020 13:13:01 +0200 Subject: [PATCH 2/2] Fix wot deserialization test, and remove ignore flag --- src/de/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/de/mod.rs b/src/de/mod.rs index 000a7f86a..4b9bde0f1 100644 --- a/src/de/mod.rs +++ b/src/de/mod.rs @@ -996,7 +996,6 @@ mod tests { // See https://iot.mozilla.org/wot/#thing-resource #[test] - #[ignore] fn wot() { #[derive(Debug, Deserialize, PartialEq)] struct Thing<'a> { @@ -1056,7 +1055,7 @@ mod tests { properties: Properties { temperature: Property { ty: Type::Number, - unit: Some("celcius"), + unit: Some("celsius"), description: Some("An ambient temperature sensor"), href: "/properties/temperature", },