Get everything to compile and fix some warnings

This commit is contained in:
Erick Tryzelaar
2015-02-11 10:54:23 -08:00
parent 1552eb72dc
commit 33633a5e14
4 changed files with 11 additions and 8 deletions
+2 -4
View File
@@ -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
View File
@@ -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())
} }
} }
+1 -1
View File
@@ -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
View File
@@ -1,4 +1,4 @@
#![feature(io)] #![feature(core, io, std_misc, unicode)]
extern crate unicode; extern crate unicode;