Merge pull request #664 from serde-rs/visitor-value

Remove the Deserialize trait bound on Visitor::Value
This commit is contained in:
David Tolnay
2017-01-08 00:24:53 -08:00
committed by GitHub
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -412,7 +412,7 @@ pub trait Deserializer {
/// This trait represents a visitor that walks through a deserializer. /// This trait represents a visitor that walks through a deserializer.
pub trait Visitor { pub trait Visitor {
/// The value produced by this visitor. /// The value produced by this visitor.
type Value: Deserialize; type Value;
/// `visit_bool` deserializes a `bool` into a `Value`. /// `visit_bool` deserializes a `bool` into a `Value`.
fn visit_bool<E>(&mut self, v: bool) -> Result<Self::Value, E> fn visit_bool<E>(&mut self, v: bool) -> Result<Self::Value, E>
+2 -2
View File
@@ -856,7 +856,7 @@ impl<'a, I> VariantVisitor for DeserializerVariantVisitor<'a, I>
} }
} }
Some(_) => { Some(_) => {
Deserialize::deserialize(self.de) de::Deserializer::deserialize(self.de, visitor)
} }
None => Err(Error::EndOfStream), None => Err(Error::EndOfStream),
} }
@@ -887,7 +887,7 @@ impl<'a, I> VariantVisitor for DeserializerVariantVisitor<'a, I>
} }
} }
Some(_) => { Some(_) => {
Deserialize::deserialize(self.de) de::Deserializer::deserialize(self.de, visitor)
} }
None => Err(Error::EndOfStream), None => Err(Error::EndOfStream),
} }