diff --git a/Cargo.toml b/Cargo.toml index adf1c7f..018a198 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,9 +24,9 @@ no-panic = { version = "0.1", optional = true } [dev-dependencies] num_cpus = "1.8" -rand = "0.9" -rand_xorshift = "0.4" -criterion = "0.5" +rand = "0.10" +rand_xorshift = "0.5" +criterion = "0.8" [lib] bench = false diff --git a/benches/bench.rs b/benches/bench.rs index ffd24b8..0036369 100644 --- a/benches/bench.rs +++ b/benches/bench.rs @@ -6,6 +6,7 @@ clippy::unreadable_literal )] +#[allow(deprecated)] use criterion::{black_box, criterion_group, criterion_main, Criterion}; use std::io::Write; @@ -17,6 +18,7 @@ macro_rules! benches { pub fn $name(c: &mut Criterion) { let mut buf = ryu_js::Buffer::new(); + #[allow(deprecated)] c.bench_function(concat!("ryu_js_", stringify!($name)), move |b| b.iter(move || { let value = black_box($value); let formatted = buf.format_finite(value); @@ -33,6 +35,7 @@ macro_rules! benches { pub fn $name(c: &mut Criterion) { let mut buf = Vec::with_capacity(20); + #[allow(deprecated)] c.bench_function(concat!("std_fmt_", stringify!($name)), move |b| b.iter(|| { buf.clear(); let value = black_box($value); diff --git a/examples/upstream_benchmark.rs b/examples/upstream_benchmark.rs index 8e227de..8e33a6e 100644 --- a/examples/upstream_benchmark.rs +++ b/examples/upstream_benchmark.rs @@ -1,6 +1,6 @@ // cargo run --example upstream_benchmark --release -use rand::{Rng, SeedableRng}; +use rand::{RngExt, SeedableRng}; const SAMPLES: usize = 10000; const ITERATIONS: usize = 1000; diff --git a/src/buffer/mod.rs b/src/buffer/mod.rs index 1c3f593..5c47a74 100644 --- a/src/buffer/mod.rs +++ b/src/buffer/mod.rs @@ -119,9 +119,9 @@ impl Buffer { } } +#[allow(clippy::non_canonical_clone_impl)] impl Clone for Buffer { #[inline] - #[allow(clippy::non_canonical_clone_impl)] // false positive https://github.com/rust-lang/rust-clippy/issues/11072 fn clone(&self) -> Self { Buffer::new() } diff --git a/src/f2s.rs b/src/f2s.rs index 987fefb..24ac81b 100644 --- a/src/f2s.rs +++ b/src/f2s.rs @@ -143,7 +143,6 @@ pub fn f2d(ieee_mantissa: u32, ieee_exponent: u32) -> FloatingDecimal32 { vr_is_trailing_zeros &= last_removed_digit == 0; last_removed_digit = (vr % 10) as u8; vr /= 10; - vp /= 10; vm /= 10; removed += 1; } diff --git a/tests/s2f_test.rs b/tests/s2f_test.rs index 5bae935..23da8c1 100644 --- a/tests/s2f_test.rs +++ b/tests/s2f_test.rs @@ -23,7 +23,6 @@ clippy::cast_lossless, clippy::cast_possible_truncation, clippy::cast_possible_wrap, - clippy::cast_possible_wrap, clippy::cast_sign_loss, clippy::checked_conversions, clippy::float_cmp,