From e3b191f81bc3fac10cc2ed1c0466ab3767571db9 Mon Sep 17 00:00:00 2001 From: Denys Vitali Date: Thu, 28 Nov 2024 23:49:31 +0100 Subject: [PATCH] fix(serde_at): deserialize _ --- serde_at/src/de/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/serde_at/src/de/mod.rs b/serde_at/src/de/mod.rs index 8cba13c..6b283a9 100644 --- a/serde_at/src/de/mod.rs +++ b/serde_at/src/de/mod.rs @@ -178,7 +178,7 @@ impl<'a> Deserializer<'a> { self.index = self.slice.len(); return Ok(&self.slice[start..]); } else if let Some(c) = self.peek() { - if (c as char).is_alphanumeric() || (c as char).is_whitespace() { + if (c as char).is_ascii() && c >= 32 { self.eat_char(); } else { return Err(Error::EofWhileParsingString); @@ -473,7 +473,7 @@ impl<'a, 'de> de::Deserializer<'de> for &'a mut Deserializer<'de> { visitor.visit_borrowed_str(self.parse_str()?) } _ => { - if (peek as char).is_alphabetic() { + if (peek as char).is_ascii() && peek >= 32 { visitor.visit_bytes(self.parse_bytes()?) } else { Err(Error::InvalidType)