Allow to run assert_de_tokens_error on token sequence that is not expected by enum deserializer
Before that fix following code panics, because `Token::Unit` was unexpected by test deserializer: ``` #[derive(Deserialize)] enum E { ... } assert_de_tokens_error::<E>(&[Token::Unit], "..."); ```
This commit is contained in:
parent
8084258a3e
commit
23c14e5f33
@ -250,9 +250,7 @@ impl<'de, 'a> de::Deserializer<'de> for &'a mut Deserializer<'de> {
|
|||||||
{
|
{
|
||||||
visitor.visit_enum(DeserializerEnumVisitor { de: self })
|
visitor.visit_enum(DeserializerEnumVisitor { de: self })
|
||||||
}
|
}
|
||||||
_ => {
|
_ => self.deserialize_any(visitor)
|
||||||
unexpected!(self.next_token());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user