mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-07-01 08:37:26 +00:00
Cleanup code, fix some incompatibilites with rust head
This commit is contained in:
@@ -9,7 +9,6 @@ use syntax::ast::{
|
||||
Item,
|
||||
Expr,
|
||||
MutMutable,
|
||||
//LitNil,
|
||||
};
|
||||
use syntax::ast;
|
||||
use syntax::codemap::{Span, respan};
|
||||
@@ -34,7 +33,6 @@ use syntax::ext::deriving::generic::ty::{
|
||||
LifetimeBounds,
|
||||
Ty,
|
||||
Path,
|
||||
//Tuple,
|
||||
borrowed_explicit_self,
|
||||
};
|
||||
use syntax::parse::token;
|
||||
|
||||
+14
-14
@@ -30,20 +30,6 @@ pub trait Visitor {
|
||||
type Value;
|
||||
type Error;
|
||||
|
||||
fn visit_unit(&mut self) -> Result<Self::Value, Self::Error>;
|
||||
|
||||
#[inline]
|
||||
fn visit_named_unit(&mut self, _name: &str) -> Result<Self::Value, Self::Error> {
|
||||
self.visit_unit()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn visit_enum_unit(&mut self,
|
||||
_name: &str,
|
||||
_variant: &str) -> Result<Self::Value, Self::Error> {
|
||||
self.visit_unit()
|
||||
}
|
||||
|
||||
fn visit_bool(&mut self, v: bool) -> Result<Self::Value, Self::Error>;
|
||||
|
||||
#[inline]
|
||||
@@ -109,6 +95,20 @@ pub trait Visitor {
|
||||
|
||||
fn visit_str(&mut self, value: &str) -> Result<Self::Value, Self::Error>;
|
||||
|
||||
fn visit_unit(&mut self) -> Result<Self::Value, Self::Error>;
|
||||
|
||||
#[inline]
|
||||
fn visit_named_unit(&mut self, _name: &str) -> Result<Self::Value, Self::Error> {
|
||||
self.visit_unit()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn visit_enum_unit(&mut self,
|
||||
_name: &str,
|
||||
_variant: &str) -> Result<Self::Value, Self::Error> {
|
||||
self.visit_unit()
|
||||
}
|
||||
|
||||
fn visit_none(&mut self) -> Result<Self::Value, Self::Error>;
|
||||
|
||||
fn visit_some<V>(&mut self, value: V) -> Result<Self::Value, Self::Error>
|
||||
|
||||
Reference in New Issue
Block a user