mirror of
https://github.com/stefanoamorelli/crabrl.git
synced 2026-04-18 07:10:42 +00:00
style: fix formatting for rustfmt compliance
- Add trailing newlines to all source files - Remove extra blank lines - Simplify closure formatting in benchmarks
This commit is contained in:
@@ -4,24 +4,21 @@ use crabrl::Parser;
|
||||
fn parse_small_file(c: &mut Criterion) {
|
||||
let parser = Parser::new();
|
||||
let content = include_bytes!("../tests/fixtures/small.xml");
|
||||
|
||||
|
||||
c.bench_function("parse_small", |b| {
|
||||
b.iter(|| {
|
||||
parser.parse_bytes(black_box(content))
|
||||
});
|
||||
b.iter(|| parser.parse_bytes(black_box(content)));
|
||||
});
|
||||
}
|
||||
|
||||
fn parse_medium_file(c: &mut Criterion) {
|
||||
let parser = Parser::new();
|
||||
let content = include_bytes!("../tests/fixtures/medium.xml");
|
||||
|
||||
|
||||
c.bench_function("parse_medium", |b| {
|
||||
b.iter(|| {
|
||||
parser.parse_bytes(black_box(content))
|
||||
});
|
||||
b.iter(|| parser.parse_bytes(black_box(content)));
|
||||
});
|
||||
}
|
||||
|
||||
criterion_group!(benches, parse_small_file, parse_medium_file);
|
||||
criterion_main!(benches);
|
||||
criterion_main!(benches);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user