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
commit fbd4a17467
2 changed files with 3 additions and 3 deletions

View File

@ -412,7 +412,7 @@ pub trait Deserializer {
/// This trait represents a visitor that walks through a deserializer.
pub trait Visitor {
/// The value produced by this visitor.
type Value: Deserialize;
type Value;
/// `visit_bool` deserializes a `bool` into a `Value`.
fn visit_bool<E>(&mut self, v: bool) -> Result<Self::Value, E>

View File

@ -856,7 +856,7 @@ impl<'a, I> VariantVisitor for DeserializerVariantVisitor<'a, I>
}
}
Some(_) => {
Deserialize::deserialize(self.de)
de::Deserializer::deserialize(self.de, visitor)
}
None => Err(Error::EndOfStream),
}
@ -887,7 +887,7 @@ impl<'a, I> VariantVisitor for DeserializerVariantVisitor<'a, I>
}
}
Some(_) => {
Deserialize::deserialize(self.de)
de::Deserializer::deserialize(self.de, visitor)
}
None => Err(Error::EndOfStream),
}