#[test]
fn test_decode_option_malformed() {
check_err::<OptionData>("{ \"opt\": [] }",
- ExpectedError("Number".into_string(), "[]".into_string()));
+ ExpectedError("Number".to_string(), "[]".to_string()));
check_err::<OptionData>("{ \"opt\": false }",
- ExpectedError("Number".into_string(), "false".into_string()));
+ ExpectedError("Number".to_string(), "false".to_string()));
}
- #[deriving(PartialEq, Encodable, Decodable, Show)]
+ #[deriving(PartialEq, RustcEncodable, RustcDecodable, Show)]
enum Animal {
Dog,
Frog(string::String, int)
}
}
- impl<D:Decoder<E>, E> Decodable<D, E> for Ident {
+ impl<D: Decoder<E>, E> Decodable<D, E> for Ident {
fn decode(d: &mut D) -> Result<Ident, E> {
- Ok(str_to_ident(try!(d.read_str()).as_slice()))
+ Ok(str_to_ident(try!(d.read_str())[]))
}
}