mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-13 07:51:03 +00:00
Rename visit_simple to visit_newtype
This commit is contained in:
@@ -924,11 +924,11 @@ impl<T, E> Deserialize for Result<T, E> where T: Deserialize, E: Deserialize {
|
||||
{
|
||||
match try!(visitor.visit_variant()) {
|
||||
Field::Ok => {
|
||||
let value = try!(visitor.visit_simple());
|
||||
let value = try!(visitor.visit_newtype());
|
||||
Ok(Ok(value))
|
||||
}
|
||||
Field::Err => {
|
||||
let value = try!(visitor.visit_simple());
|
||||
let value = try!(visitor.visit_newtype());
|
||||
Ok(Err(value))
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -579,8 +579,8 @@ pub trait VariantVisitor {
|
||||
Err(Error::syntax_error())
|
||||
}
|
||||
|
||||
/// `visit_simple` is called when deserializing a variant with a single value.
|
||||
fn visit_simple<T>(&mut self) -> Result<T, Self::Error>
|
||||
/// `visit_newtype` is called when deserializing a variant with a single value.
|
||||
fn visit_newtype<T>(&mut self) -> Result<T, Self::Error>
|
||||
where T: Deserialize,
|
||||
{
|
||||
Err(Error::syntax_error())
|
||||
@@ -618,10 +618,10 @@ impl<'a, T> VariantVisitor for &'a mut T where T: VariantVisitor {
|
||||
(**self).visit_unit()
|
||||
}
|
||||
|
||||
fn visit_simple<D>(&mut self) -> Result<D, T::Error>
|
||||
fn visit_newtype<D>(&mut self) -> Result<D, T::Error>
|
||||
where D: Deserialize,
|
||||
{
|
||||
(**self).visit_simple()
|
||||
(**self).visit_newtype()
|
||||
}
|
||||
|
||||
fn visit_tuple<V>(&mut self,
|
||||
|
||||
Reference in New Issue
Block a user