Skip to content

Commit e769d7a

Browse files
author
Markus Westerlind
committed
Fix clippy
1 parent 1d3fd89 commit e769d7a

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

src/de.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,13 +1554,10 @@ impl<'de, 'a, R: Read<'de>> de::Deserializer<'de> for &'a mut Deserializer<R> {
15541554
{
15551555
let mut buf = String::new();
15561556

1557-
match tri!(self.parse_whitespace_in_value()) {
1558-
b'-' => {
1559-
self.eat_char();
1560-
buf.push('-');
1561-
}
1562-
_ => {}
1563-
};
1557+
if tri!(self.parse_whitespace_in_value()) == b'-' {
1558+
self.eat_char();
1559+
buf.push('-');
1560+
}
15641561

15651562
tri!(self.scan_integer128(&mut buf));
15661563

@@ -1581,11 +1578,8 @@ impl<'de, 'a, R: Read<'de>> de::Deserializer<'de> for &'a mut Deserializer<R> {
15811578
where
15821579
V: de::Visitor<'de>,
15831580
{
1584-
match tri!(self.parse_whitespace_in_value()) {
1585-
b'-' => {
1586-
return Err(self.peek_error(ErrorCode::NumberOutOfRange));
1587-
}
1588-
_ => {}
1581+
if tri!(self.parse_whitespace_in_value()) == b'-' {
1582+
return Err(self.peek_error(ErrorCode::NumberOutOfRange));
15891583
}
15901584

15911585
let mut buf = String::new();

0 commit comments

Comments
 (0)