Fix clippy lints in serde_test

This commit is contained in:
David Tolnay 2017-01-25 20:42:44 -08:00
parent 68aab2424f
commit 87040b4bc4
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -273,7 +273,7 @@ impl<'a, I> de::Deserializer for &'a mut Deserializer<I>
where V: Visitor,
{
match self.tokens.peek() {
Some(&Token::Option(false)) => {
Some(&Token::Unit) | Some(&Token::Option(false)) => {
self.tokens.next();
visitor.visit_none()
}
@ -281,10 +281,6 @@ impl<'a, I> de::Deserializer for &'a mut Deserializer<I>
self.tokens.next();
visitor.visit_some(self)
}
Some(&Token::Unit) => {
self.tokens.next();
visitor.visit_none()
}
Some(_) => visitor.visit_some(self),
None => Err(Error::EndOfTokens),
}
@ -316,7 +312,7 @@ impl<'a, I> de::Deserializer for &'a mut Deserializer<I>
let token = self.tokens.next().unwrap();
Err(Error::UnexpectedToken(token))
}
None => { return Err(Error::EndOfTokens); }
None => Err(Error::EndOfTokens),
}
}
@ -377,11 +373,7 @@ impl<'a, I> de::Deserializer for &'a mut Deserializer<I>
where V: Visitor,
{
match self.tokens.peek() {
Some(&Token::Unit) => {
self.tokens.next();
visitor.visit_unit()
}
Some(&Token::UnitStruct(_)) => {
Some(&Token::Unit) | Some(&Token::UnitStruct(_)) => {
self.tokens.next();
visitor.visit_unit()
}