From 7206db4b0b2c77dc0cf1db85a65e69629bbc2360 Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Sun, 25 May 2014 21:51:12 -0700 Subject: [PATCH] Minor cleanup --- bench_vec.rs | 74 ++++++++++++++++++++++++++-------------------------- de.rs | 2 -- 2 files changed, 37 insertions(+), 39 deletions(-) diff --git a/bench_vec.rs b/bench_vec.rs index 14f05b71..a3a39cce 100644 --- a/bench_vec.rs +++ b/bench_vec.rs @@ -380,14 +380,6 @@ fn bench_decoder_vec_int_000(b: &mut Bencher) { }) } -#[bench] -fn bench_deserializer_vec_int_000(b: &mut Bencher) { - b.iter(|| { - let v: Vec = vec!(); - run_deserializer(deserializer::IntDeserializer::new(v.clone()), v) - }) -} - #[bench] fn bench_decoder_vec_int_003(b: &mut Bencher) { b.iter(|| { @@ -396,14 +388,6 @@ fn bench_decoder_vec_int_003(b: &mut Bencher) { }) } -#[bench] -fn bench_deserializer_vec_int_003(b: &mut Bencher) { - b.iter(|| { - let v: Vec = vec!(1, 2, 3); - run_deserializer(deserializer::IntDeserializer::new(v.clone()), v) - }) -} - #[bench] fn bench_decoder_vec_int_100(b: &mut Bencher) { b.iter(|| { @@ -412,14 +396,6 @@ fn bench_decoder_vec_int_100(b: &mut Bencher) { }) } -#[bench] -fn bench_deserializer_vec_int_100(b: &mut Bencher) { - b.iter(|| { - let v: Vec = range(0, 100).collect(); - run_deserializer(deserializer::IntDeserializer::new(v.clone()), v) - }) -} - #[bench] fn bench_decoder_vec_u8_000(b: &mut Bencher) { b.iter(|| { @@ -428,14 +404,6 @@ fn bench_decoder_vec_u8_000(b: &mut Bencher) { }) } -#[bench] -fn bench_deserializer_vec_u8_000(b: &mut Bencher) { - b.iter(|| { - let v: Vec = vec!(); - run_deserializer(deserializer::U8Deserializer::new(v.clone()), v) - }) -} - #[bench] fn bench_decoder_vec_u8_003(b: &mut Bencher) { b.iter(|| { @@ -445,18 +413,50 @@ fn bench_decoder_vec_u8_003(b: &mut Bencher) { } #[bench] -fn bench_deserializer_vec_u8_003(b: &mut Bencher) { +fn bench_decoder_vec_u8_100(b: &mut Bencher) { b.iter(|| { - let v: Vec = vec!(1, 2, 3); + let v: Vec = range(0u8, 100).collect(); + run_decoder(decoder::U8Decoder::new(v.clone()), v) + }) +} + +#[bench] +fn bench_deserializer_vec_int_000(b: &mut Bencher) { + b.iter(|| { + let v: Vec = vec!(); + run_deserializer(deserializer::IntDeserializer::new(v.clone()), v) + }) +} + +#[bench] +fn bench_deserializer_vec_int_003(b: &mut Bencher) { + b.iter(|| { + let v: Vec = vec!(1, 2, 3); + run_deserializer(deserializer::IntDeserializer::new(v.clone()), v) + }) +} + +#[bench] +fn bench_deserializer_vec_int_100(b: &mut Bencher) { + b.iter(|| { + let v: Vec = range(0, 100).collect(); + run_deserializer(deserializer::IntDeserializer::new(v.clone()), v) + }) +} + +#[bench] +fn bench_deserializer_vec_u8_000(b: &mut Bencher) { + b.iter(|| { + let v: Vec = vec!(); run_deserializer(deserializer::U8Deserializer::new(v.clone()), v) }) } #[bench] -fn bench_decoder_vec_u8_100(b: &mut Bencher) { +fn bench_deserializer_vec_u8_003(b: &mut Bencher) { b.iter(|| { - let v: Vec = range(0u8, 100).collect(); - run_decoder(decoder::U8Decoder::new(v.clone()), v) + let v: Vec = vec!(1, 2, 3); + run_deserializer(deserializer::U8Deserializer::new(v.clone()), v) }) } diff --git a/de.rs b/de.rs index f8bdec05..7f3d72c8 100644 --- a/de.rs +++ b/de.rs @@ -398,8 +398,6 @@ impl< } } - try!(d.expect_end()); - Ok(value) } }