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

View File

@ -1,8 +1,6 @@
#![feature(plugin, io)]
#![feature(collections, core, io, plugin, test)]
#![allow(non_camel_case_types)]
#[plugin]
extern crate serde2_macros;
#![plugin(serde2_macros)]
extern crate serde2;
extern crate "rustc-serialize" as rustc_serialize;

View File

@ -728,12 +728,17 @@ mod tests {
enum Error {
SyntaxError,
EndOfStreamError,
MissingFieldError(&'static str),
}
impl super::Error for Error {
fn syntax_error() -> Error { Error::SyntaxError }
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> {
@ -1183,11 +1188,11 @@ mod tests {
fn visit_enum<
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" {
self.visit_variant(variant, visitor)
} else {
Err(super::Error::syntax_error());
Err(super::Error::syntax_error())
}
}

View File

@ -95,7 +95,7 @@ impl error::Error for Error {
fn description(&self) -> &str {
match *self {
Error::SyntaxError(..) => "syntax error",
Error::IoError(ref error) => error.description().as_slice(),
Error::IoError(ref error) => error.description(),
/*
Error::ExpectedError(ref expected, _) => &expected,
*/

View File

@ -1,4 +1,4 @@
#![feature(io)]
#![feature(core, io, std_misc, unicode)]
extern crate unicode;