Merge pull request #225 from jwilm/hint-ignored-any

feat(de): Support hinting for IgnoredAny
This commit is contained in:
Erick Tryzelaar 2016-02-05 07:56:30 -08:00
commit 9b349d08cc
2 changed files with 11 additions and 1 deletions

View File

@ -1004,7 +1004,8 @@ impl Deserialize for IgnoredAny {
}
}
deserializer.deserialize(IgnoredAnyVisitor)
// TODO maybe not necessary with impl specialization
deserializer.deserialize_ignored_any(IgnoredAnyVisitor)
}
}

View File

@ -416,6 +416,15 @@ pub trait Deserializer {
self.deserialize(visitor)
}
/// This method hints that the `Deserialize` type needs to deserialize a value whose type
/// doesn't matter because it is ignored.
#[inline]
fn deserialize_ignored_any<V>(&mut self, visitor: V) -> Result<V::Value, Self::Error>
where V: Visitor
{
self.deserialize(visitor)
}
/// Specify a format string for the deserializer.
///
/// The deserializer format is used to determine which format