diff --git a/benches/bench_log.rs b/benches/bench_log.rs index 61e15b4a..65796ca2 100644 --- a/benches/bench_log.rs +++ b/benches/bench_log.rs @@ -1,4 +1,4 @@ -#![feature(custom_derive, collections, core, io, plugin, test)] +#![feature(custom_derive, collections, core, plugin, test)] #![allow(non_camel_case_types)] #![plugin(serde_macros)] diff --git a/benches/bench_map.rs b/benches/bench_map.rs index 50b243d4..601a7640 100644 --- a/benches/bench_map.rs +++ b/benches/bench_map.rs @@ -1,4 +1,4 @@ -#![feature(custom_derive, core, plugin, test)] +#![feature(custom_derive, plugin, test)] #![plugin(serde_macros)] extern crate serde; @@ -403,7 +403,7 @@ fn bench_decoder_000(b: &mut Bencher) { fn bench_decoder_003(b: &mut Bencher) { b.iter(|| { let mut m: HashMap = HashMap::new(); - for i in range(0, 3) { + for i in (0 .. 3) { m.insert(i.to_string(), i); } run_decoder(decoder::IsizeDecoder::new(m.clone()), m) @@ -414,7 +414,7 @@ fn bench_decoder_003(b: &mut Bencher) { fn bench_decoder_100(b: &mut Bencher) { b.iter(|| { let mut m: HashMap = HashMap::new(); - for i in range(0, 100) { + for i in (0 .. 100) { m.insert(i.to_string(), i); } run_decoder(decoder::IsizeDecoder::new(m.clone()), m) @@ -443,7 +443,7 @@ fn bench_deserializer_000(b: &mut Bencher) { fn bench_deserializer_003(b: &mut Bencher) { b.iter(|| { let mut m: HashMap = HashMap::new(); - for i in range(0, 3) { + for i in (0 .. 3) { m.insert(i.to_string(), i); } run_deserializer(deserializer::IsizeDeserializer::new(m.clone()), m) @@ -454,7 +454,7 @@ fn bench_deserializer_003(b: &mut Bencher) { fn bench_deserializer_100(b: &mut Bencher) { b.iter(|| { let mut m: HashMap = HashMap::new(); - for i in range(0, 100) { + for i in (0 .. 100) { m.insert(i.to_string(), i); } run_deserializer(deserializer::IsizeDeserializer::new(m.clone()), m) diff --git a/benches/bench_vec.rs b/benches/bench_vec.rs index 90706963..2d96548b 100644 --- a/benches/bench_vec.rs +++ b/benches/bench_vec.rs @@ -1,4 +1,4 @@ -#![feature(core, plugin, test)] +#![feature(plugin, test)] #![plugin(serde_macros)] extern crate serde; @@ -537,7 +537,7 @@ fn bench_decoder_usize_003(b: &mut Bencher) { #[bench] fn bench_decoder_usize_100(b: &mut Bencher) { b.iter(|| { - let v: Vec = range(0, 100).collect(); + let v: Vec = (0 .. 100).collect(); run_decoder(decoder::UsizeDecoder::new(v.clone()), v) }) } @@ -561,7 +561,7 @@ fn bench_decoder_u8_003(b: &mut Bencher) { #[bench] fn bench_decoder_u8_100(b: &mut Bencher) { b.iter(|| { - let v: Vec = range(0u8, 100).collect(); + let v: Vec = (0 .. 100).collect(); run_decoder(decoder::U8Decoder::new(v.clone()), v) }) } @@ -585,7 +585,7 @@ fn bench_deserializer_usize_003(b: &mut Bencher) { #[bench] fn bench_deserializer_usize_100(b: &mut Bencher) { b.iter(|| { - let v: Vec = range(0, 100).collect(); + let v: Vec = (0 .. 100).collect(); run_deserializer(deserializer::Deserializer::new(v.clone()), v) }) } @@ -609,7 +609,7 @@ fn bench_deserializer_u8_003(b: &mut Bencher) { #[bench] fn bench_deserializer_u8_100(b: &mut Bencher) { b.iter(|| { - let v: Vec = range(0u8, 100).collect(); + let v: Vec = (0 .. 100).collect(); run_deserializer(deserializer::Deserializer::new(v.clone()), v) }) } diff --git a/serde_macros/src/de.rs b/serde_macros/src/de.rs index ea2d68bf..ff512979 100644 --- a/serde_macros/src/de.rs +++ b/serde_macros/src/de.rs @@ -289,7 +289,7 @@ fn deserialize_seq( struct_path: ast::Path, fields: usize, ) -> P { - let let_values: Vec> = (0 .. fields) + let let_values: Vec> = (0 .. fields) .map(|i| { let name = builder.id(format!("__field{}", i)); quote_stmt!(cx, @@ -299,7 +299,7 @@ fn deserialize_seq( return Err(::serde::de::Error::end_of_stream_error()); } }; - ) + ).unwrap() }) .collect(); @@ -659,7 +659,7 @@ fn deserialize_map( // Declare each field. let let_values: Vec> = field_names.iter() - .map(|field_name| quote_stmt!(cx, let mut $field_name = None;)) + .map(|field_name| quote_stmt!(cx, let mut $field_name = None;).unwrap()) .collect(); // Match arms to extract a value for a field. @@ -692,7 +692,7 @@ fn deserialize_map( Some($field_name) => $field_name, None => $missing_expr, }; - ) + ).unwrap() }) .collect(); diff --git a/src/lib.rs b/src/lib.rs index 85fd10c5..60257b97 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -#![feature(core, io, std_misc, unicode)] +#![feature(core, std_misc, unicode)] extern crate unicode;