mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-18 07:21:02 +00:00
Get everything to compile and fix some warnings
This commit is contained in:
@@ -1,8 +1,6 @@
|
|||||||
#![feature(plugin, io)]
|
#![feature(collections, core, io, plugin, test)]
|
||||||
#![allow(non_camel_case_types)]
|
#![allow(non_camel_case_types)]
|
||||||
|
#![plugin(serde2_macros)]
|
||||||
#[plugin]
|
|
||||||
extern crate serde2_macros;
|
|
||||||
|
|
||||||
extern crate serde2;
|
extern crate serde2;
|
||||||
extern crate "rustc-serialize" as rustc_serialize;
|
extern crate "rustc-serialize" as rustc_serialize;
|
||||||
|
|||||||
+7
-2
@@ -728,12 +728,17 @@ mod tests {
|
|||||||
enum Error {
|
enum Error {
|
||||||
SyntaxError,
|
SyntaxError,
|
||||||
EndOfStreamError,
|
EndOfStreamError,
|
||||||
|
MissingFieldError(&'static str),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl super::Error for Error {
|
impl super::Error for Error {
|
||||||
fn syntax_error() -> Error { Error::SyntaxError }
|
fn syntax_error() -> Error { Error::SyntaxError }
|
||||||
|
|
||||||
fn end_of_stream_error() -> Error { Error::EndOfStreamError }
|
fn end_of_stream_error() -> Error { Error::EndOfStreamError }
|
||||||
|
|
||||||
|
fn missing_field_error(field: &'static str) -> Error {
|
||||||
|
Error::MissingFieldError(field)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Deserializer for TokenDeserializer<'a> {
|
impl<'a> Deserializer for TokenDeserializer<'a> {
|
||||||
@@ -1183,11 +1188,11 @@ mod tests {
|
|||||||
|
|
||||||
fn visit_enum<
|
fn visit_enum<
|
||||||
V: super::EnumVisitor,
|
V: super::EnumVisitor,
|
||||||
>(&mut self, name: &str, variant: &str, mut visitor: V) -> Result<Enum, V::Error> {
|
>(&mut self, name: &str, variant: &str, visitor: V) -> Result<Enum, V::Error> {
|
||||||
if name == "Enum" {
|
if name == "Enum" {
|
||||||
self.visit_variant(variant, visitor)
|
self.visit_variant(variant, visitor)
|
||||||
} else {
|
} else {
|
||||||
Err(super::Error::syntax_error());
|
Err(super::Error::syntax_error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ impl error::Error for Error {
|
|||||||
fn description(&self) -> &str {
|
fn description(&self) -> &str {
|
||||||
match *self {
|
match *self {
|
||||||
Error::SyntaxError(..) => "syntax error",
|
Error::SyntaxError(..) => "syntax error",
|
||||||
Error::IoError(ref error) => error.description().as_slice(),
|
Error::IoError(ref error) => error.description(),
|
||||||
/*
|
/*
|
||||||
Error::ExpectedError(ref expected, _) => &expected,
|
Error::ExpectedError(ref expected, _) => &expected,
|
||||||
*/
|
*/
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#![feature(io)]
|
#![feature(core, io, std_misc, unicode)]
|
||||||
|
|
||||||
extern crate unicode;
|
extern crate unicode;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user