Support ignoring enum with IgnoredAny
This commit is contained in:
parent
1c97a7ecb3
commit
e75efbfd31
@ -1,6 +1,8 @@
|
||||
use lib::*;
|
||||
|
||||
use de::{Deserialize, Deserializer, Error, MapAccess, SeqAccess, Visitor};
|
||||
use de::{
|
||||
Deserialize, Deserializer, EnumAccess, Error, MapAccess, SeqAccess, VariantAccess, Visitor,
|
||||
};
|
||||
|
||||
/// An efficient way of discarding data from a deserializer.
|
||||
///
|
||||
@ -205,6 +207,14 @@ impl<'de> Visitor<'de> for IgnoredAny {
|
||||
let _ = bytes;
|
||||
Ok(IgnoredAny)
|
||||
}
|
||||
|
||||
fn visit_enum<A>(self, data: A) -> Result<Self::Value, A::Error>
|
||||
where
|
||||
A: EnumAccess<'de>,
|
||||
{
|
||||
let (IgnoredAny, content) = data.variant()?;
|
||||
content.newtype_variant()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'de> Deserialize<'de> for IgnoredAny {
|
||||
|
Loading…
x
Reference in New Issue
Block a user