From 60e4ac239f3e8d6c570af093780e2282319ec6a4 Mon Sep 17 00:00:00 2001 From: Markus Westerlind Date: Tue, 12 Jan 2021 11:36:45 +0100 Subject: [PATCH] Fix clippy --- src/de.rs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/de.rs b/src/de.rs index 63cca7b0d..e263f333a 100644 --- a/src/de.rs +++ b/src/de.rs @@ -1572,13 +1572,10 @@ impl<'de, 'a, R: Read<'de>> de::Deserializer<'de> for &'a mut Deserializer { { let mut buf = String::new(); - match tri!(self.parse_whitespace_in_value()) { - b'-' => { - self.eat_char(); - buf.push('-'); - } - _ => {} - }; + if tri!(self.parse_whitespace_in_value()) == b'-' { + self.eat_char(); + buf.push('-'); + } tri!(self.scan_integer128(&mut buf)); @@ -1599,11 +1596,8 @@ impl<'de, 'a, R: Read<'de>> de::Deserializer<'de> for &'a mut Deserializer { where V: de::Visitor<'de>, { - match tri!(self.parse_whitespace_in_value()) { - b'-' => { - return Err(self.peek_error(ErrorCode::NumberOutOfRange)); - } - _ => {} + if tri!(self.parse_whitespace_in_value()) == b'-' { + return Err(self.peek_error(ErrorCode::NumberOutOfRange)); } let mut buf = String::new();