mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-12 14:21:01 +00:00
Minor cleanup
This commit is contained in:
+6
-2
@@ -580,7 +580,9 @@ pub trait VariantVisitor {
|
||||
}
|
||||
|
||||
/// `visit_simple` is called when deserializing a variant with a single value.
|
||||
fn visit_simple<T: Deserialize>(&mut self) -> Result<T, Self::Error> {
|
||||
fn visit_simple<T>(&mut self) -> Result<T, Self::Error>
|
||||
where T: Deserialize,
|
||||
{
|
||||
Err(Error::syntax_error())
|
||||
}
|
||||
|
||||
@@ -616,7 +618,9 @@ impl<'a, T> VariantVisitor for &'a mut T where T: VariantVisitor {
|
||||
(**self).visit_unit()
|
||||
}
|
||||
|
||||
fn visit_simple<D: Deserialize>(&mut self) -> Result<D, T::Error> {
|
||||
fn visit_simple<D>(&mut self) -> Result<D, T::Error>
|
||||
where D: Deserialize,
|
||||
{
|
||||
(**self).visit_simple()
|
||||
}
|
||||
|
||||
|
||||
@@ -126,8 +126,8 @@ impl<T, Iter> SeqVisitor for SeqIteratorVisitor<Iter>
|
||||
{
|
||||
match self.iter.next() {
|
||||
Some(value) => {
|
||||
let value = try!(serializer.visit_seq_elt(value));
|
||||
Ok(Some(value))
|
||||
try!(serializer.visit_seq_elt(value));
|
||||
Ok(Some(()))
|
||||
}
|
||||
None => Ok(None),
|
||||
}
|
||||
|
||||
@@ -129,8 +129,7 @@ pub trait Serializer {
|
||||
fn visit_enum_simple<T>(&mut self,
|
||||
_name: &str,
|
||||
_variant: &str,
|
||||
_value: T,
|
||||
) -> Result<(), Self::Error>
|
||||
_value: T) -> Result<(), Self::Error>
|
||||
where T: Serialize;
|
||||
|
||||
fn visit_none(&mut self) -> Result<(), Self::Error>;
|
||||
|
||||
Reference in New Issue
Block a user