Skip to content

Commit acf605d

Browse files
committed
Run cargo fmt in compare project
1 parent 222532c commit acf605d

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

compare/benches/bench.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ fn low_level_comparison(c: &mut Criterion) {
5858
*data,
5959
|b, input| {
6060
b.iter(|| {
61-
let mut r = Reader::from_reader(input.as_bytes());
62-
r.config_mut().check_end_names = false;
61+
let mut reader = Reader::from_reader(input.as_bytes());
62+
reader.config_mut().check_end_names = false;
6363
let mut count = criterion::black_box(0);
6464
let mut buf = Vec::new();
6565
loop {
66-
match r.read_event_into(&mut buf) {
66+
match reader.read_event_into(&mut buf) {
6767
Ok(Event::Start(_)) | Ok(Event::Empty(_)) => count += 1,
6868
Ok(Event::Eof) => break,
6969
_ => (),
@@ -79,8 +79,8 @@ fn low_level_comparison(c: &mut Criterion) {
7979
BenchmarkId::new("maybe_xml", filename),
8080
*data,
8181
|b, input| {
82-
use maybe_xml::Lexer;
8382
use maybe_xml::token::Ty;
83+
use maybe_xml::Lexer;
8484

8585
b.iter(|| {
8686
let lexer = Lexer::from_slice(input.as_bytes());
@@ -272,7 +272,8 @@ fn serde_comparison(c: &mut Criterion) {
272272
}
273273

274274
b.iter(|| {
275-
let rss: Rss<Enclosure> = criterion::black_box(quick_xml::de::from_str(input).unwrap());
275+
let rss: Rss<Enclosure> =
276+
criterion::black_box(quick_xml::de::from_str(input).unwrap());
276277
assert_eq!(rss.channel.items.len(), 99);
277278
})
278279
},
@@ -307,7 +308,8 @@ fn serde_comparison(c: &mut Criterion) {
307308
}
308309

309310
b.iter(|| {
310-
let rss: Rss<Enclosure> = criterion::black_box(serde_xml_rs::from_str(input).unwrap());
311+
let rss: Rss<Enclosure> =
312+
criterion::black_box(serde_xml_rs::from_str(input).unwrap());
311313
assert_eq!(rss.channel.items.len(), 99);
312314
})
313315
},

0 commit comments

Comments
 (0)