Skip to content

Commit d3daa48

Browse files
authored
fixed formatting of benches and use cargo fmt instead of rustfmt in CI Format (#96)
1 parent 4a48d4d commit d3daa48

2 files changed

Lines changed: 17 additions & 13 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- uses: dsherret/rust-toolchain-file@v1
1919

2020
- name: Format
21-
run: rustfmt --check src/lib.rs
21+
run: cargo fmt --check --all
2222

2323
- name: Build
2424
run: cargo build --release --all-targets --all-features

benches/parse_patterns.rs

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
1-
use criterion::{black_box, criterion_group, criterion_main, Criterion};
1+
use criterion::{Criterion, black_box, criterion_group, criterion_main};
22
use urlpattern::quirks::{self, EcmaRegexp};
33

44
fn bench_parse_shipping_groups_summary(c: &mut Criterion) {
5-
c.bench_function("parse component-ShippingGroupsSummary.*.js", |b| {
6-
b.iter(|| {
7-
let input = quirks::process_construct_pattern_input(
8-
black_box(quirks::StringOrInit::String(
9-
"component-ShippingGroupsSummary.*.js".to_owned()
10-
)),
11-
black_box(Some("https://example.test/web/")),
12-
);
13-
quirks::parse_pattern::<EcmaRegexp>(input.unwrap(), urlpattern::UrlPatternOptions::default()).unwrap();
14-
})
15-
});
5+
c.bench_function("parse component-ShippingGroupsSummary.*.js", |b| {
6+
b.iter(|| {
7+
let input = quirks::process_construct_pattern_input(
8+
black_box(quirks::StringOrInit::String(
9+
"component-ShippingGroupsSummary.*.js".to_owned(),
10+
)),
11+
black_box(Some("https://example.test/web/")),
12+
);
13+
quirks::parse_pattern::<EcmaRegexp>(
14+
input.unwrap(),
15+
urlpattern::UrlPatternOptions::default(),
16+
)
17+
.unwrap();
18+
})
19+
});
1620
}
1721

1822
criterion_group!(benches, bench_parse_shipping_groups_summary);

0 commit comments

Comments
 (0)