[INFO] cloning repository https://github.com/blueglyph/schubfach_rs [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/blueglyph/schubfach_rs" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fblueglyph%2Fschubfach_rs", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fblueglyph%2Fschubfach_rs'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 8f2ed169e26a171903600f9a3aaefabf9599f746 [INFO] linting blueglyph/schubfach_rs against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fblueglyph%2Fschubfach_rs" "/workspace/builds/worker-3-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-3-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/blueglyph/schubfach_rs [INFO] finished tweaking git repo https://github.com/blueglyph/schubfach_rs [INFO] tweaked toml for git repo https://github.com/blueglyph/schubfach_rs written to /workspace/builds/worker-3-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/blueglyph/schubfach_rs on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/blueglyph/schubfach_rs already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded ilog v1.0.1 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 141fceacbb61645490805dce2e541884b2e4a87c596eb68f073b32b354abeae1 [INFO] running `Command { std: "docker" "start" "-a" "141fceacbb61645490805dce2e541884b2e4a87c596eb68f073b32b354abeae1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "141fceacbb61645490805dce2e541884b2e4a87c596eb68f073b32b354abeae1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "141fceacbb61645490805dce2e541884b2e4a87c596eb68f073b32b354abeae1", kill_on_drop: false }` [INFO] [stdout] 141fceacbb61645490805dce2e541884b2e4a87c596eb68f073b32b354abeae1 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] b202ea6084573c94aee4e13e880f669b5447db58018e371feb9e908dbe48fbf0 [INFO] running `Command { std: "docker" "start" "-a" "b202ea6084573c94aee4e13e880f669b5447db58018e371feb9e908dbe48fbf0", kill_on_drop: false }` [INFO] [stderr] Compiling num-traits v0.2.15 [INFO] [stderr] Compiling num-bigint v0.4.3 [INFO] [stderr] Compiling num-iter v0.1.43 [INFO] [stderr] Compiling num-rational v0.4.1 [INFO] [stderr] Checking ilog v1.0.1 [INFO] [stderr] Checking oorandom v11.1.3 [INFO] [stderr] Checking schubfach v0.0.1 (/opt/rustwide/workdir) [INFO] [stdout] warning: can be more succinctly written as a byte str [INFO] [stdout] --> src/lib.rs:378:39 [INFO] [stdout] | [INFO] [stdout] 378 | const DIGITS100: &[u8; 200] = &[ [INFO] [stdout] | _______________________________________^ [INFO] [stdout] 379 | | b'0', b'0', b'0', b'1', b'0', b'2', b'0', b'3', b'0', b'4', b'0', b'5', b'0', b'6', b'0', b'7', b'0', b'8', b'0', b'9', [INFO] [stdout] 380 | | b'1', b'0', b'1', b'1', b'1', b'2', b'1', b'3', b'1', b'4', b'1', b'5', b'1', b'6', b'1', b'7', b'1', b'8', b'1', b'9', [INFO] [stdout] 381 | | b'2', b'0', b'2', b'1', b'2', b'2', b'2', b'3', b'2', b'4', b'2', b'5', b'2', b'6', b'2', b'7', b'2', b'8', b'2', b'9', [INFO] [stdout] ... | [INFO] [stdout] 388 | | b'9', b'0', b'9', b'1', b'9', b'2', b'9', b'3', b'9', b'4', b'9', b'5', b'9', b'6', b'9', b'7', b'9', b'8', b'9', b'9', [INFO] [stdout] 389 | | ]; [INFO] [stdout] | |_________^ help: try: `b"00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#byte_char_slices [INFO] [stdout] = note: `#[warn(clippy::byte_char_slices)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/maths.rs:16:19 [INFO] [stdout] | [INFO] [stdout] 16 | debug_assert!(-1233 <= x && x <= 1233); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(-1233..=1233).contains(&x)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/maths.rs:662:19 [INFO] [stdout] | [INFO] [stdout] 662 | debug_assert!(K_MIN <= x && x <= K_MAX); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(K_MIN..=K_MAX).contains(&x)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/maths.rs:678:5 [INFO] [stdout] | [INFO] [stdout] 678 | return (value & ((1_u64 << e2) - 1)) == 0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 678 - return (value & ((1_u64 << e2) - 1)) == 0; [INFO] [stdout] 678 + (value & ((1_u64 << e2) - 1)) == 0 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/maths.rs:677:19 [INFO] [stdout] | [INFO] [stdout] 677 | debug_assert!(0 <= e2 && e2 <= 64); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: use: `(0..=64).contains(&e2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `StdFixValues` [INFO] [stdout] --> src/test_values.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 24 | / pub fn new() -> Self { [INFO] [stdout] 25 | | // if MIN_FIXED_DECIMAL_POINT = -3 => 0.000[d-d] is the limit => 1e-4 is the limit [INFO] [stdout] 26 | | // for std as fixed-format [INFO] [stdout] 27 | | let min_exp = >::MIN_FIXED_DECIMAL_POINT - 1; [INFO] [stdout] ... | [INFO] [stdout] 49 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 23 + impl Default for StdFixValues { [INFO] [stdout] 24 + fn default() -> Self { [INFO] [stdout] 25 + Self::new() [INFO] [stdout] 26 + } [INFO] [stdout] 27 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i32::abs()` to usize [INFO] [stdout] --> src/test_values.rs:30:58 [INFO] [stdout] | [INFO] [stdout] 30 | let min_fix_str = "0.".to_string() + &"0".repeat(min_exp.abs() as usize - 1) + "1"; [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace with: `min_exp.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] = note: `#[warn(clippy::cast_abs_to_unsigned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i32::abs()` to usize [INFO] [stdout] --> src/test_values.rs:31:58 [INFO] [stdout] | [INFO] [stdout] 31 | let low_fix_str = "0.".to_string() + &"0".repeat(min_exp.abs() as usize) + "1"; [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace with: `min_exp.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i32::abs()` to usize [INFO] [stdout] --> src/test_values.rs:40:57 [INFO] [stdout] | [INFO] [stdout] 40 | let max_fix_str = "2".to_string() + &"0".repeat(max_exp.abs() as usize) + ".0"; [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace with: `max_exp.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i32::abs()` to usize [INFO] [stdout] --> src/test_values.rs:41:58 [INFO] [stdout] | [INFO] [stdout] 41 | let high_fix_str = "2".to_string() + &"0".repeat(max_exp.abs() as usize + 1) + ".0"; [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace with: `max_exp.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/lib.rs:207:23 [INFO] [stdout] | [INFO] [stdout] 207 | debug_assert!(-1500 <= q && q <= 1500); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(-1500..=1500).contains(&q)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/lib.rs:210:23 [INFO] [stdout] | [INFO] [stdout] 210 | debug_assert!(1 <= h && h <= 4); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: use: `(1..=4).contains(&h)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `NumFmtBuffer` [INFO] [stdout] --> src/lib.rs:359:5 [INFO] [stdout] | [INFO] [stdout] 359 | / pub fn new() -> Self { [INFO] [stdout] 360 | | let size = Self::BUFFER_LEN; [INFO] [stdout] 361 | | let layout = Layout::array::(size).expect("cannot create layout"); [INFO] [stdout] 362 | | let buffer = unsafe { alloc::alloc(layout) }; [INFO] [stdout] ... | [INFO] [stdout] 366 | | NumFmtBuffer { buffer, ptr: buffer, size, options: FmtOptions::default() } [INFO] [stdout] 367 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 356 + impl Default for NumFmtBuffer { [INFO] [stdout] 357 + fn default() -> Self { [INFO] [stdout] 358 + Self::new() [INFO] [stdout] 359 + } [INFO] [stdout] 360 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/lib.rs:425:23 [INFO] [stdout] | [INFO] [stdout] 425 | debug_assert!(1 <= value && value <= 99999999); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(1..=99999999).contains(&value)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/lib.rs:433:28 [INFO] [stdout] | [INFO] [stdout] 433 | self.write_2digits(offset + 0, qh); [INFO] [stdout] | ^^^^^^^^^^ help: consider reducing it to: `offset` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] = note: `#[warn(clippy::identity_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/lib.rs:485:36 [INFO] [stdout] | [INFO] [stdout] 485 | self.write_2digits(offset + 0, rh); [INFO] [stdout] | ^^^^^^^^^^ help: consider reducing it to: `offset` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/lib.rs:526:23 [INFO] [stdout] | [INFO] [stdout] 526 | debug_assert!(1 <= output && output <= 99, "output: {output}"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(1..=99).contains(&output)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/lib.rs:537:27 [INFO] [stdout] | [INFO] [stdout] 537 | debug_assert!(1 <= q && q <= 9); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: use: `(1..=9).contains(&q)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/lib.rs:573:16 [INFO] [stdout] | [INFO] [stdout] 573 | if !tie || (tie && *ptr & 1 != 0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 573 - if !tie || (tie && *ptr & 1 != 0) { [INFO] [stdout] 573 + if !(tie && *ptr & 1 == 0) { [INFO] [stdout] | [INFO] [stdout] 573 - if !tie || (tie && *ptr & 1 != 0) { [INFO] [stdout] 573 + if !tie || *ptr & 1 != 0 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unsafe function's docs are missing a `# Safety` section [INFO] [stdout] --> src/lib.rs:610:5 [INFO] [stdout] | [INFO] [stdout] 610 | unsafe fn simple_format(&mut self, decoded: Decoded) -> usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc [INFO] [stdout] = note: `#[warn(clippy::missing_safety_doc)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i32::abs()` to usize [INFO] [stdout] --> src/lib.rs:677:26 [INFO] [stdout] | [INFO] [stdout] 677 | max(24, 20 + Self::MIN_FIXED_DECIMAL_POINT.abs() as usize), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `Self::MIN_FIXED_DECIMAL_POINT.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/lib.rs:694:25 [INFO] [stdout] | [INFO] [stdout] 694 | let use_fixed = Self::MIN_FIXED_DECIMAL_POINT <= decimal_point && decimal_point <= Self::MAX_FIXED_DECIMAL_POINT; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(Self::MIN_FIXED_DECIMAL_POINT..=Self::MAX_FIXED_DECIMAL_POINT).contains(&decimal_point)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i32::abs()` to u32 [INFO] [stdout] --> src/lib.rs:767:21 [INFO] [stdout] | [INFO] [stdout] 767 | let k = scientific_exponent.abs() as u32; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `scientific_exponent.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i32::abs()` to usize [INFO] [stdout] --> src/lib.rs:788:26 [INFO] [stdout] | [INFO] [stdout] 788 | max(24, 20 + Self::MIN_FIXED_DECIMAL_POINT.abs() as usize), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `Self::MIN_FIXED_DECIMAL_POINT.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/lib.rs:809:25 [INFO] [stdout] | [INFO] [stdout] 809 | let width = self.options.width [INFO] [stdout] | _________________________^ [INFO] [stdout] 810 | | .and_then(|width| Some(min(width - decimal.sign as u32, self.size as u32))); [INFO] [stdout] | |___________________________________________________________________________________________^ help: try: `self.options.width.map(|width| min(width - decimal.sign as u32, self.size as u32))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/lib.rs:811:33 [INFO] [stdout] | [INFO] [stdout] 811 | let mut precision = self.options.precision [INFO] [stdout] | _________________________________^ [INFO] [stdout] 812 | | .and_then(|prec| Some(min(prec, self.size as u32 - 18))); [INFO] [stdout] | |________________________________________________________________________^ help: try: `self.options.precision.map(|prec| min(prec, self.size as u32 - 18))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/lib.rs:817:40 [INFO] [stdout] | [INFO] [stdout] 817 | let decimal_point_inside = Self::MIN_FIXED_DECIMAL_POINT <= decimal_point && [INFO] [stdout] | ________________________________________^ [INFO] [stdout] 818 | | decimal_point <= Self::MAX_FIXED_DECIMAL_POINT; [INFO] [stdout] | |__________________________________________________________________^ help: use: `(Self::MIN_FIXED_DECIMAL_POINT..=Self::MAX_FIXED_DECIMAL_POINT).contains(&decimal_point)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/lib.rs:1098:33 [INFO] [stdout] | [INFO] [stdout] 1098 | ... 1 + p as usize [INFO] [stdout] | ^^^^^^^^^^ help: try: `p` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/lib.rs:1318:17 [INFO] [stdout] | [INFO] [stdout] 1317 | let length = self.ptr.offset_from(self.buffer) as usize; [INFO] [stdout] | -------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 1318 | length [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 1317 ~ [INFO] [stdout] 1318 ~ self.ptr.offset_from(self.buffer) as usize [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i32::abs()` to u32 [INFO] [stdout] --> src/lib.rs:1302:25 [INFO] [stdout] | [INFO] [stdout] 1302 | let k = scientific_exponent.abs() as u32; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `scientific_exponent.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/lib.rs:1490:29 [INFO] [stdout] | [INFO] [stdout] 1490 | fmt.options.width = f.width().and_then(|x| Some(x as u32)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `f.width().map(|x| x as u32)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/lib.rs:1491:33 [INFO] [stdout] | [INFO] [stdout] 1491 | fmt.options.precision = f.precision().and_then(|x| Some(x as u32)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `f.precision().map(|x| x as u32)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking num-integer v0.1.45 [INFO] [stderr] Checking num-complex v0.4.3 [INFO] [stderr] Checking num v0.4.0 [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> tests/rounding.rs:33:40 [INFO] [stdout] | [INFO] [stdout] 33 | let val = f64::from_str(&sval).expect(&format!("error converting {} to f64", sval)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("error converting {} to f64", sval))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u8` -> `u8`) [INFO] [stdout] --> tests/rounding.rs:96:28 [INFO] [stdout] | [INFO] [stdout] 96 | value.push(step as u8 - INIT_STEP + INIT_DIGIT); [INFO] [stdout] | ^^^^^^^^^^ help: try: `step` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u8` -> `u8`) [INFO] [stdout] --> tests/rounding.rs:99:20 [INFO] [stdout] | [INFO] [stdout] 99 | if step as u8 - INIT_STEP + INIT_DIGIT == STOP_DIGIT { [INFO] [stdout] | ^^^^^^^^^^ help: try: `step` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u8` -> `u8`) [INFO] [stdout] --> tests/rounding.rs:112:56 [INFO] [stdout] | [INFO] [stdout] 112 | ... self.base.push(1 + digit as u8); [INFO] [stdout] | ^^^^^^^^^^^ help: try: `digit` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item without indentation [INFO] [stdout] --> tests/rounding.rs:146:5 [INFO] [stdout] | [INFO] [stdout] 146 | /// `pr` digits in the fractional part. [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation [INFO] [stdout] = note: `#[warn(clippy::doc_lazy_continuation)]` on by default [INFO] [stdout] help: indent this line [INFO] [stdout] | [INFO] [stdout] 146 | /// `pr` digits in the fractional part. [INFO] [stdout] | ++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like the same item is being pushed into this `Vec` [INFO] [stdout] --> tests/rounding.rs:159:17 [INFO] [stdout] | [INFO] [stdout] 159 | s.push(b'0'); [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: consider using `vec![b'0';SIZE]` [INFO] [stdout] = help: or `s.extend(std::iter::repeat_n(b'0', SIZE))` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push [INFO] [stdout] = note: `#[warn(clippy::same_item_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.iter().nth()` on a `Vec` [INFO] [stdout] --> tests/rounding.rs:170:27 [INFO] [stdout] | [INFO] [stdout] 170 | let ch = *s.iter().nth(pos + pr + 1).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth [INFO] [stdout] = note: `#[warn(clippy::iter_nth)]` on by default [INFO] [stdout] help: `get` is equivalent but more concise [INFO] [stdout] | [INFO] [stdout] 170 - let ch = *s.iter().nth(pos + pr + 1).unwrap(); [INFO] [stdout] 170 + let ch = *s.get(pos + pr + 1).unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like the same item is being pushed into this `Vec` [INFO] [stdout] --> tests/rounding.rs:212:29 [INFO] [stdout] | [INFO] [stdout] 212 | ... s.push(b'0'); [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: consider using `vec![b'0';SIZE]` [INFO] [stdout] = help: or `s.extend(std::iter::repeat_n(b'0', SIZE))` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like the same item is being pushed into this `Vec` [INFO] [stdout] --> tests/rounding.rs:218:25 [INFO] [stdout] | [INFO] [stdout] 218 | s.push(b'0'); [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: consider using `vec![b'0';SIZE]` [INFO] [stdout] = help: or `s.extend(std::iter::repeat_n(b'0', SIZE))` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: can be more succinctly written as a byte str [INFO] [stdout] --> src/lib.rs:378:39 [INFO] [stdout] | [INFO] [stdout] 378 | const DIGITS100: &[u8; 200] = &[ [INFO] [stdout] | _______________________________________^ [INFO] [stdout] 379 | | b'0', b'0', b'0', b'1', b'0', b'2', b'0', b'3', b'0', b'4', b'0', b'5', b'0', b'6', b'0', b'7', b'0', b'8', b'0', b'9', [INFO] [stdout] 380 | | b'1', b'0', b'1', b'1', b'1', b'2', b'1', b'3', b'1', b'4', b'1', b'5', b'1', b'6', b'1', b'7', b'1', b'8', b'1', b'9', [INFO] [stdout] 381 | | b'2', b'0', b'2', b'1', b'2', b'2', b'2', b'3', b'2', b'4', b'2', b'5', b'2', b'6', b'2', b'7', b'2', b'8', b'2', b'9', [INFO] [stdout] ... | [INFO] [stdout] 388 | | b'9', b'0', b'9', b'1', b'9', b'2', b'9', b'3', b'9', b'4', b'9', b'5', b'9', b'6', b'9', b'7', b'9', b'8', b'9', b'9', [INFO] [stdout] 389 | | ]; [INFO] [stdout] | |_________^ help: try: `b"00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#byte_char_slices [INFO] [stdout] = note: `#[warn(clippy::byte_char_slices)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i32::abs()` to usize [INFO] [stdout] --> src/tests/test_ftoa.rs:12:15 [INFO] [stdout] | [INFO] [stdout] 12 | let min = >::MIN_FIXED_DECIMAL_POINT.abs() as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `>::MIN_FIXED_DECIMAL_POINT.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] = note: `#[warn(clippy::cast_abs_to_unsigned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/tests/test_ftoa.rs:26:38 [INFO] [stdout] | [INFO] [stdout] 26 | for (idx, (value, exp)) in tests.into_iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/tests/test_ftoa.rs:60:38 [INFO] [stdout] | [INFO] [stdout] 60 | let f2 = f64::from_str(&res).expect(&format!("test #{i}: could not convert {f} -> '{res}' -> f64")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("test #{i}: could not convert {f} -> '{res}' -> f64"))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/tests/test_format.rs:8:28 [INFO] [stdout] | [INFO] [stdout] 8 | fn test_format_opt(values: Vec<(f64, Option, Option, FmtMode, bool, &str)>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/tests/test_schubfach.rs:310:34 [INFO] [stdout] | [INFO] [stdout] 310 | Err(_) => return Err(format!("Error when parsing string to float")), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Error when parsing string to float".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `panic!` args [INFO] [stdout] --> src/tests/test_schubfach.rs:575:77 [INFO] [stdout] | [INFO] [stdout] 575 | Err(e) => panic!("{}", format!("cannot parse value {}: {}", s, e.to_string())) [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this assertion has a constant value [INFO] [stdout] --> src/tests/mod.rs:26:5 [INFO] [stdout] | [INFO] [stdout] 26 | assert!(NumFmtBuffer::MIN_FIXED_DECIMAL_POINT <= -1, "internal error"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider moving this into a const block: `const { assert!(..) }` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants [INFO] [stdout] = note: `#[warn(clippy::assertions_on_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this assertion has a constant value [INFO] [stdout] --> src/tests/mod.rs:27:5 [INFO] [stdout] | [INFO] [stdout] 27 | assert!(NumFmtBuffer::MIN_FIXED_DECIMAL_POINT >= -30, "internal error"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider moving this into a const block: `const { assert!(..) }` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this assertion has a constant value [INFO] [stdout] --> src/tests/mod.rs:28:5 [INFO] [stdout] | [INFO] [stdout] 28 | assert!(NumFmtBuffer::MAX_FIXED_DECIMAL_POINT >= 1, "internal error"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider moving this into a const block: `const { assert!(..) }` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this assertion has a constant value [INFO] [stdout] --> src/tests/mod.rs:29:5 [INFO] [stdout] | [INFO] [stdout] 29 | assert!(NumFmtBuffer::MAX_FIXED_DECIMAL_POINT <= 32, "internal error"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider moving this into a const block: `const { assert!(..) }` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/maths.rs:16:19 [INFO] [stdout] | [INFO] [stdout] 16 | debug_assert!(-1233 <= x && x <= 1233); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(-1233..=1233).contains(&x)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/maths.rs:662:19 [INFO] [stdout] | [INFO] [stdout] 662 | debug_assert!(K_MIN <= x && x <= K_MAX); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(K_MIN..=K_MAX).contains(&x)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/maths.rs:678:5 [INFO] [stdout] | [INFO] [stdout] 678 | return (value & ((1_u64 << e2) - 1)) == 0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 678 - return (value & ((1_u64 << e2) - 1)) == 0; [INFO] [stdout] 678 + (value & ((1_u64 << e2) - 1)) == 0 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/maths.rs:677:19 [INFO] [stdout] | [INFO] [stdout] 677 | debug_assert!(0 <= e2 && e2 <= 64); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: use: `(0..=64).contains(&e2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `StdFixValues` [INFO] [stdout] --> src/test_values.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 24 | / pub fn new() -> Self { [INFO] [stdout] 25 | | // if MIN_FIXED_DECIMAL_POINT = -3 => 0.000[d-d] is the limit => 1e-4 is the limit [INFO] [stdout] 26 | | // for std as fixed-format [INFO] [stdout] 27 | | let min_exp = >::MIN_FIXED_DECIMAL_POINT - 1; [INFO] [stdout] ... | [INFO] [stdout] 49 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 23 + impl Default for StdFixValues { [INFO] [stdout] 24 + fn default() -> Self { [INFO] [stdout] 25 + Self::new() [INFO] [stdout] 26 + } [INFO] [stdout] 27 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i32::abs()` to usize [INFO] [stdout] --> src/test_values.rs:30:58 [INFO] [stdout] | [INFO] [stdout] 30 | let min_fix_str = "0.".to_string() + &"0".repeat(min_exp.abs() as usize - 1) + "1"; [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace with: `min_exp.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i32::abs()` to usize [INFO] [stdout] --> src/test_values.rs:31:58 [INFO] [stdout] | [INFO] [stdout] 31 | let low_fix_str = "0.".to_string() + &"0".repeat(min_exp.abs() as usize) + "1"; [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace with: `min_exp.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i32::abs()` to usize [INFO] [stdout] --> src/test_values.rs:40:57 [INFO] [stdout] | [INFO] [stdout] 40 | let max_fix_str = "2".to_string() + &"0".repeat(max_exp.abs() as usize) + ".0"; [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace with: `max_exp.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i32::abs()` to usize [INFO] [stdout] --> src/test_values.rs:41:58 [INFO] [stdout] | [INFO] [stdout] 41 | let high_fix_str = "2".to_string() + &"0".repeat(max_exp.abs() as usize + 1) + ".0"; [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace with: `max_exp.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/lib.rs:207:23 [INFO] [stdout] | [INFO] [stdout] 207 | debug_assert!(-1500 <= q && q <= 1500); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(-1500..=1500).contains(&q)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/lib.rs:210:23 [INFO] [stdout] | [INFO] [stdout] 210 | debug_assert!(1 <= h && h <= 4); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: use: `(1..=4).contains(&h)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `NumFmtBuffer` [INFO] [stdout] --> src/lib.rs:359:5 [INFO] [stdout] | [INFO] [stdout] 359 | / pub fn new() -> Self { [INFO] [stdout] 360 | | let size = Self::BUFFER_LEN; [INFO] [stdout] 361 | | let layout = Layout::array::(size).expect("cannot create layout"); [INFO] [stdout] 362 | | let buffer = unsafe { alloc::alloc(layout) }; [INFO] [stdout] ... | [INFO] [stdout] 366 | | NumFmtBuffer { buffer, ptr: buffer, size, options: FmtOptions::default() } [INFO] [stdout] 367 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 356 + impl Default for NumFmtBuffer { [INFO] [stdout] 357 + fn default() -> Self { [INFO] [stdout] 358 + Self::new() [INFO] [stdout] 359 + } [INFO] [stdout] 360 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/lib.rs:425:23 [INFO] [stdout] | [INFO] [stdout] 425 | debug_assert!(1 <= value && value <= 99999999); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(1..=99999999).contains(&value)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/lib.rs:433:28 [INFO] [stdout] | [INFO] [stdout] 433 | self.write_2digits(offset + 0, qh); [INFO] [stdout] | ^^^^^^^^^^ help: consider reducing it to: `offset` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] = note: `#[warn(clippy::identity_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/lib.rs:485:36 [INFO] [stdout] | [INFO] [stdout] 485 | self.write_2digits(offset + 0, rh); [INFO] [stdout] | ^^^^^^^^^^ help: consider reducing it to: `offset` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/lib.rs:526:23 [INFO] [stdout] | [INFO] [stdout] 526 | debug_assert!(1 <= output && output <= 99, "output: {output}"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(1..=99).contains(&output)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/lib.rs:537:27 [INFO] [stdout] | [INFO] [stdout] 537 | debug_assert!(1 <= q && q <= 9); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: use: `(1..=9).contains(&q)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/lib.rs:573:16 [INFO] [stdout] | [INFO] [stdout] 573 | if !tie || (tie && *ptr & 1 != 0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 573 - if !tie || (tie && *ptr & 1 != 0) { [INFO] [stdout] 573 + if !(tie && *ptr & 1 == 0) { [INFO] [stdout] | [INFO] [stdout] 573 - if !tie || (tie && *ptr & 1 != 0) { [INFO] [stdout] 573 + if !tie || *ptr & 1 != 0 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unsafe function's docs are missing a `# Safety` section [INFO] [stdout] --> src/lib.rs:610:5 [INFO] [stdout] | [INFO] [stdout] 610 | unsafe fn simple_format(&mut self, decoded: Decoded) -> usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc [INFO] [stdout] = note: `#[warn(clippy::missing_safety_doc)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i32::abs()` to usize [INFO] [stdout] --> src/lib.rs:677:26 [INFO] [stdout] | [INFO] [stdout] 677 | max(24, 20 + Self::MIN_FIXED_DECIMAL_POINT.abs() as usize), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `Self::MIN_FIXED_DECIMAL_POINT.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/lib.rs:694:25 [INFO] [stdout] | [INFO] [stdout] 694 | let use_fixed = Self::MIN_FIXED_DECIMAL_POINT <= decimal_point && decimal_point <= Self::MAX_FIXED_DECIMAL_POINT; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(Self::MIN_FIXED_DECIMAL_POINT..=Self::MAX_FIXED_DECIMAL_POINT).contains(&decimal_point)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i32::abs()` to u32 [INFO] [stdout] --> src/lib.rs:767:21 [INFO] [stdout] | [INFO] [stdout] 767 | let k = scientific_exponent.abs() as u32; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `scientific_exponent.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i32::abs()` to usize [INFO] [stdout] --> src/lib.rs:788:26 [INFO] [stdout] | [INFO] [stdout] 788 | max(24, 20 + Self::MIN_FIXED_DECIMAL_POINT.abs() as usize), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `Self::MIN_FIXED_DECIMAL_POINT.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/lib.rs:809:25 [INFO] [stdout] | [INFO] [stdout] 809 | let width = self.options.width [INFO] [stdout] | _________________________^ [INFO] [stdout] 810 | | .and_then(|width| Some(min(width - decimal.sign as u32, self.size as u32))); [INFO] [stdout] | |___________________________________________________________________________________________^ help: try: `self.options.width.map(|width| min(width - decimal.sign as u32, self.size as u32))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/lib.rs:811:33 [INFO] [stdout] | [INFO] [stdout] 811 | let mut precision = self.options.precision [INFO] [stdout] | _________________________________^ [INFO] [stdout] 812 | | .and_then(|prec| Some(min(prec, self.size as u32 - 18))); [INFO] [stdout] | |________________________________________________________________________^ help: try: `self.options.precision.map(|prec| min(prec, self.size as u32 - 18))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/lib.rs:817:40 [INFO] [stdout] | [INFO] [stdout] 817 | let decimal_point_inside = Self::MIN_FIXED_DECIMAL_POINT <= decimal_point && [INFO] [stdout] | ________________________________________^ [INFO] [stdout] 818 | | decimal_point <= Self::MAX_FIXED_DECIMAL_POINT; [INFO] [stdout] | |__________________________________________________________________^ help: use: `(Self::MIN_FIXED_DECIMAL_POINT..=Self::MAX_FIXED_DECIMAL_POINT).contains(&decimal_point)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/lib.rs:1098:33 [INFO] [stdout] | [INFO] [stdout] 1098 | ... 1 + p as usize [INFO] [stdout] | ^^^^^^^^^^ help: try: `p` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/lib.rs:1318:17 [INFO] [stdout] | [INFO] [stdout] 1317 | let length = self.ptr.offset_from(self.buffer) as usize; [INFO] [stdout] | -------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 1318 | length [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 1317 ~ [INFO] [stdout] 1318 ~ self.ptr.offset_from(self.buffer) as usize [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i32::abs()` to u32 [INFO] [stdout] --> src/lib.rs:1302:25 [INFO] [stdout] | [INFO] [stdout] 1302 | let k = scientific_exponent.abs() as u32; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `scientific_exponent.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/lib.rs:1490:29 [INFO] [stdout] | [INFO] [stdout] 1490 | fmt.options.width = f.width().and_then(|x| Some(x as u32)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `f.width().map(|x| x as u32)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/lib.rs:1491:33 [INFO] [stdout] | [INFO] [stdout] 1491 | fmt.options.precision = f.precision().and_then(|x| Some(x as u32)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `f.precision().map(|x| x as u32)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/tests/mod.rs:35:14 [INFO] [stdout] | [INFO] [stdout] 35 | for f in vec![1.0, -1.0, f64::NAN, f64::INFINITY, f64::NEG_INFINITY, 0.0, 1e10, -1.5e-8] { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[1.0, -1.0, f64::NAN, f64::INFINITY, f64::NEG_INFINITY, 0.0, 1e10, -1.5e-8]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary transmute [INFO] [stdout] --> src/tests/test_ftoa.rs:54:26 [INFO] [stdout] | [INFO] [stdout] 54 | f = unsafe { mem::transmute::(ieee) }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unnecessary_transmutes)]` on by default [INFO] [stdout] help: replace this with [INFO] [stdout] | [INFO] [stdout] 54 - f = unsafe { mem::transmute::(ieee) }; [INFO] [stdout] 54 + f = unsafe { f64::from_bits(ieee) }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.44s [INFO] running `Command { std: "docker" "inspect" "b202ea6084573c94aee4e13e880f669b5447db58018e371feb9e908dbe48fbf0", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "b202ea6084573c94aee4e13e880f669b5447db58018e371feb9e908dbe48fbf0", kill_on_drop: false }` [INFO] [stdout] b202ea6084573c94aee4e13e880f669b5447db58018e371feb9e908dbe48fbf0