CI: Lint benchmarks

This commit is contained in:
Paul Dicker 2024-03-06 18:46:14 +01:00 committed by Paul Dicker
parent 2d2f1a9670
commit 31145976e1
2 changed files with 3 additions and 3 deletions

View File

@ -29,10 +29,10 @@ jobs:
cargo clippy --target=x86_64-pc-windows-msvc --all-targets --color=always \
-- -D warnings
- run: |
cargo clippy --manifest-path fuzz/Cargo.toml --color=always \
cargo clippy --manifest-path fuzz/Cargo.toml --all-targets --color=always \
-- -D warnings
- run: |
cargo clippy --manifest-path bench/Cargo.toml --color=always \
cargo clippy --manifest-path bench/Cargo.toml --all-targets --color=always \
-- -D warnings
env:
RUSTFLAGS: "-Dwarnings"

View File

@ -208,7 +208,7 @@ fn bench_format_manual(c: &mut Criterion) {
fn bench_naivedate_add_signed(c: &mut Criterion) {
let date = NaiveDate::from_ymd_opt(2023, 7, 29).unwrap();
let extra = TimeDelta::days(25);
let extra = TimeDelta::try_days(25).unwrap();
c.bench_function("bench_naivedate_add_signed", |b| {
b.iter(|| black_box(date).checked_add_signed(extra).unwrap())
});