From f2a6f0e710ea93991e0f747c7799ef394b640e96 Mon Sep 17 00:00:00 2001 From: Thomas Bahn Date: Fri, 6 Feb 2015 21:02:17 +0100 Subject: [PATCH] Follow rust std: `fmt::Writer` is implemented by `String` --- benches/bench_log.rs | 8 ++++---- serde2/benches/bench_log.rs | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benches/bench_log.rs b/benches/bench_log.rs index 4d7ed731..6194bcae 100755 --- a/benches/bench_log.rs +++ b/benches/bench_log.rs @@ -674,21 +674,21 @@ fn test_encoder() { let log = Log::new(); - let mut wr = Vec::with_capacity(1024); + let mut wr = String::with_capacity(1024); { let mut encoder = rustc_serialize::json::Encoder::new(&mut wr); log.encode(&mut encoder).unwrap(); } - assert_eq!(&wr[], JSON_STR.as_bytes()); + assert_eq!(&wr[], JSON_STR); } #[bench] fn bench_encoder(b: &mut Bencher) { let log = Log::new(); - let mut wr = Vec::with_capacity(1024); + let mut wr = String::with_capacity(1024); { let mut encoder = rustc_serialize::json::Encoder::new(&mut wr); @@ -731,7 +731,7 @@ fn test_serializer_vec() { log.serialize(&mut serializer).unwrap(); let json = serializer.unwrap(); - assert_eq!(json.as_slice(), JSON_STR.as_bytes()); + assert_eq!(&json[], JSON_STR.as_bytes()); } #[bench] diff --git a/serde2/benches/bench_log.rs b/serde2/benches/bench_log.rs index 42bbefdd..4edb6c9b 100644 --- a/serde2/benches/bench_log.rs +++ b/serde2/benches/bench_log.rs @@ -982,21 +982,21 @@ fn test_encoder() { let log = Log::new(); - let mut wr = Vec::with_capacity(1024); + let mut wr = String::with_capacity(1024); { let mut encoder = rustc_serialize::json::Encoder::new(&mut wr); log.encode(&mut encoder).unwrap(); } - assert_eq!(&wr[], JSON_STR.as_bytes()); + assert_eq!(&wr[], JSON_STR); } #[bench] fn bench_encoder(b: &mut Bencher) { let log = Log::new(); - let mut wr = Vec::with_capacity(1024); + let mut wr = String::with_capacity(1024); { let mut encoder = rustc_serialize::json::Encoder::new(&mut wr);