[INFO] cloning repository https://github.com/Narsil/euleur-rust [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/Narsil/euleur-rust" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FNarsil%2Feuleur-rust", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FNarsil%2Feuleur-rust'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] b17845906d1074ccb473aacc8fa715cc8ceb110d [INFO] linting Narsil/euleur-rust against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FNarsil%2Feuleur-rust" "/workspace/builds/worker-4-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-4-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/Narsil/euleur-rust [INFO] finished tweaking git repo https://github.com/Narsil/euleur-rust [INFO] tweaked toml for git repo https://github.com/Narsil/euleur-rust written to /workspace/builds/worker-4-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/Narsil/euleur-rust 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/Narsil/euleur-rust 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] Downloading crates ... [INFO] [stderr] Downloaded bytecount v0.6.0 [INFO] [stderr] Downloaded hermit-abi v0.1.12 [INFO] [stderr] Downloaded proc-macro-error-attr v1.0.2 [INFO] [stderr] Downloaded proc-macro-error v1.0.2 [INFO] [stderr] Downloaded proc-macro2 v1.0.12 [INFO] [stderr] Downloaded structopt-derive v0.4.7 [INFO] [stderr] Downloaded structopt v0.3.14 [INFO] [stderr] Downloaded quote v1.0.4 [INFO] [stderr] Downloaded syn v1.0.19 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-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] 2a2ce96f7cd96442182d253c3feca67a5dacc2c13d3c85a7db2421f947effb32 [INFO] running `Command { std: "docker" "start" "-a" "2a2ce96f7cd96442182d253c3feca67a5dacc2c13d3c85a7db2421f947effb32", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "2a2ce96f7cd96442182d253c3feca67a5dacc2c13d3c85a7db2421f947effb32", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "2a2ce96f7cd96442182d253c3feca67a5dacc2c13d3c85a7db2421f947effb32", kill_on_drop: false }` [INFO] [stdout] 2a2ce96f7cd96442182d253c3feca67a5dacc2c13d3c85a7db2421f947effb32 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-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] 62fef9c574f91b20f588805936c7c3b518306120d766dc02585dd187f68266c6 [INFO] running `Command { std: "docker" "start" "-a" "62fef9c574f91b20f588805936c7c3b518306120d766dc02585dd187f68266c6", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.12 [INFO] [stderr] Compiling num-traits v0.2.11 [INFO] [stderr] Compiling version_check v0.9.1 [INFO] [stderr] Compiling syn v1.0.19 [INFO] [stderr] Compiling num-integer v0.1.42 [INFO] [stderr] Compiling libc v0.2.69 [INFO] [stderr] Compiling num-bigint v0.2.6 [INFO] [stderr] Compiling num-rational v0.2.4 [INFO] [stderr] Compiling num-iter v0.1.40 [INFO] [stderr] Compiling num-complex v0.2.4 [INFO] [stderr] Checking unicode-width v0.1.7 [INFO] [stderr] Compiling unicode-segmentation v1.6.0 [INFO] [stderr] Checking ansi_term v0.11.0 [INFO] [stderr] Checking either v1.5.3 [INFO] [stderr] Checking maplit v1.0.2 [INFO] [stderr] Checking bytecount v0.6.0 [INFO] [stderr] Checking textwrap v0.11.0 [INFO] [stderr] Checking itertools v0.9.0 [INFO] [stderr] Compiling proc-macro-error-attr v1.0.2 [INFO] [stderr] Compiling proc-macro-error v1.0.2 [INFO] [stderr] Compiling heck v0.3.1 [INFO] [stderr] Checking atty v0.2.14 [INFO] [stderr] Checking clap v2.33.0 [INFO] [stderr] Compiling quote v1.0.4 [INFO] [stderr] Checking num v0.2.1 [INFO] [stderr] Compiling syn-mid v0.5.0 [INFO] [stderr] Compiling structopt-derive v0.4.7 [INFO] [stderr] Checking structopt v0.3.14 [INFO] [stderr] Checking euler-rust v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: this is a decimal constant [INFO] [stdout] --> src/fifty_sixty.rs:706:39 [INFO] [stdout] | [INFO] [stdout] 706 | assert_eq!(p.next(), Some((2, 011_000))); [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_prefixed_literal [INFO] [stdout] = note: `#[warn(clippy::zero_prefixed_literal)]` on by default [INFO] [stdout] help: if you mean to use a decimal constant, remove the `0` to avoid confusion [INFO] [stdout] | [INFO] [stdout] 706 - assert_eq!(p.next(), Some((2, 011_000))); [INFO] [stdout] 706 + assert_eq!(p.next(), Some((2, 11_000))); [INFO] [stdout] | [INFO] [stdout] help: if you mean to use an octal constant, use `0o` [INFO] [stdout] | [INFO] [stdout] 706 | assert_eq!(p.next(), Some((2, 0o11_000))); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this is a decimal constant [INFO] [stdout] --> src/fifty_sixty.rs:708:39 [INFO] [stdout] | [INFO] [stdout] 708 | assert_eq!(p.next(), Some((0, 000_011))); [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_prefixed_literal [INFO] [stdout] help: if you mean to use a decimal constant, remove the `0` to avoid confusion [INFO] [stdout] | [INFO] [stdout] 708 - assert_eq!(p.next(), Some((0, 000_011))); [INFO] [stdout] 708 + assert_eq!(p.next(), Some((0, 11))); [INFO] [stdout] | [INFO] [stdout] help: if you mean to use an octal constant, use `0o` [INFO] [stdout] | [INFO] [stdout] 708 - assert_eq!(p.next(), Some((0, 000_011))); [INFO] [stdout] 708 + assert_eq!(p.next(), Some((0, 0o11))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around closure body [INFO] [stdout] --> src/forty_fifty.rs:45:66 [INFO] [stdout] | [INFO] [stdout] 45 | let pan_number = from_digits(&permutation.iter().map(|i| (8 - i)).collect::>()[..]); [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 45 - let pan_number = from_digits(&permutation.iter().map(|i| (8 - i)).collect::>()[..]); [INFO] [stdout] 45 + let pan_number = from_digits(&permutation.iter().map(|i| 8 - i ).collect::>()[..]); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around closure body [INFO] [stdout] --> src/thirty_forty.rs:248:49 [INFO] [stdout] | [INFO] [stdout] 248 | let digits = permutation.iter().map(|i| (10 - i)).collect::>(); [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 248 - let digits = permutation.iter().map(|i| (10 - i)).collect::>(); [INFO] [stdout] 248 + let digits = permutation.iter().map(|i| 10 - i ).collect::>(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around closure body [INFO] [stdout] --> src/forty_fifty.rs:45:66 [INFO] [stdout] | [INFO] [stdout] 45 | let pan_number = from_digits(&permutation.iter().map(|i| (8 - i)).collect::>()[..]); [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 45 - let pan_number = from_digits(&permutation.iter().map(|i| (8 - i)).collect::>()[..]); [INFO] [stdout] 45 + let pan_number = from_digits(&permutation.iter().map(|i| 8 - i ).collect::>()[..]); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around closure body [INFO] [stdout] --> src/thirty_forty.rs:248:49 [INFO] [stdout] | [INFO] [stdout] 248 | let digits = permutation.iter().map(|i| (10 - i)).collect::>(); [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 248 - let digits = permutation.iter().map(|i| (10 - i)).collect::>(); [INFO] [stdout] 248 + let digits = permutation.iter().map(|i| 10 - i ).collect::>(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/arithmetic.rs:12:22 [INFO] [stdout] | [INFO] [stdout] 12 | if n > *a && n % a == 0 { [INFO] [stdout] | ^^^^^^^^^^ help: replace with: `n.is_multiple_of(*a)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/arithmetic.rs:73:15 [INFO] [stdout] | [INFO] [stdout] 73 | while number % prime == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace with: `number.is_multiple_of(*prime)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `reserve` immediately after creation [INFO] [stdout] --> src/eleven_twenty.rs:195:5 [INFO] [stdout] | [INFO] [stdout] 195 | / let mut result = vec![]; [INFO] [stdout] 196 | | result.reserve(100); [INFO] [stdout] | |________________________^ help: consider using `Vec::with_capacity(/* Space hint */)`: `let mut result = Vec::with_capacity(100);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#reserve_after_initialization [INFO] [stdout] = note: `#[warn(clippy::reserve_after_initialization)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/eleven_twenty.rs:229:12 [INFO] [stdout] | [INFO] [stdout] 229 | if i % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^ help: replace with: `i.is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/eleven_twenty.rs:426:8 [INFO] [stdout] | [INFO] [stdout] 426 | if year % 400 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace with: `year.is_multiple_of(400)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/eleven_twenty.rs:428:15 [INFO] [stdout] | [INFO] [stdout] 428 | } else if year % 100 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace with: `year.is_multiple_of(100)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/eleven_twenty.rs:430:15 [INFO] [stdout] | [INFO] [stdout] 430 | } else if year % 4 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace with: `year.is_multiple_of(4)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u64` -> `u64`) [INFO] [stdout] --> src/fifty_sixty.rs:35:23 [INFO] [stdout] | [INFO] [stdout] 35 | sum + 10u64.pow((*i).try_into().unwrap()) as u64 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `10u64.pow((*i).try_into().unwrap())` [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: useless conversion to the same type: `usize` [INFO] [stdout] --> src/fifty_sixty.rs:73:26 [INFO] [stdout] | [INFO] [stdout] 73 | if self.take_n > n_digits.try_into().unwrap() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/fifty_sixty.rs:92:23 [INFO] [stdout] | [INFO] [stdout] 92 | while r == None { [INFO] [stdout] | ^^^^^^^^^ help: use `Option::is_none()` instead: `r.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&pp).is_none()` [INFO] [stdout] --> src/fifty_sixty.rs:151:45 [INFO] [stdout] | [INFO] [stdout] 151 | if pp > max_p || primes_set.get(&pp).is_none() { [INFO] [stdout] | -----------^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: replace it with: `!primes_set.contains(&pp)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] = note: `#[warn(clippy::unnecessary_get_then_check)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> src/fifty_sixty.rs:288:1 [INFO] [stdout] | [INFO] [stdout] 288 | / impl PartialOrd for Card { [INFO] [stdout] 289 | | fn partial_cmp(&self, other: &Card) -> Option { [INFO] [stdout] 290 | | self.value.partial_cmp(&other.value) [INFO] [stdout] 291 | | } [INFO] [stdout] 292 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] = note: `#[warn(clippy::non_canonical_partial_ord_impl)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 289 - fn partial_cmp(&self, other: &Card) -> Option { [INFO] [stdout] 290 - self.value.partial_cmp(&other.value) [INFO] [stdout] 291 - } [INFO] [stdout] 289 + fn partial_cmp(&self, other: &Card) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&number).is_some()` [INFO] [stdout] --> src/fifty_sixty.rs:529:27 [INFO] [stdout] | [INFO] [stdout] 529 | if primes_set.get(&number).is_some() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains(&number)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `reserve` immediately after creation [INFO] [stdout] --> src/fifty_sixty.rs:546:5 [INFO] [stdout] | [INFO] [stdout] 546 | / let mut v = vec![]; [INFO] [stdout] 547 | | v.reserve(string.len()); [INFO] [stdout] | |____________________________^ help: consider using `Vec::with_capacity(/* Space hint */)`: `let mut v = Vec::with_capacity(string.len());` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#reserve_after_initialization [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `chunk.get(0)` [INFO] [stdout] --> src/fifty_sixty.rs:551:26 [INFO] [stdout] | [INFO] [stdout] 551 | if let Some(x) = chunk.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `chunk.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&n).is_none()` [INFO] [stdout] --> src/fifty_sixty.rs:624:31 [INFO] [stdout] | [INFO] [stdout] 624 | if primes_set.get(&n).is_none() { [INFO] [stdout] | -----------^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: replace it with: `!primes_set.contains(&n)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&n).is_none()` [INFO] [stdout] --> src/fifty_sixty.rs:633:31 [INFO] [stdout] | [INFO] [stdout] 633 | if primes_set.get(&n).is_none() { [INFO] [stdout] | -----------^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: replace it with: `!primes_set.contains(&n)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/arithmetic.rs:12:22 [INFO] [stdout] | [INFO] [stdout] 12 | if n > *a && n % a == 0 { [INFO] [stdout] | ^^^^^^^^^^ help: replace with: `n.is_multiple_of(*a)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/arithmetic.rs:73:15 [INFO] [stdout] | [INFO] [stdout] 73 | while number % prime == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace with: `number.is_multiple_of(*prime)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/fifty_sixty.rs:810:17 [INFO] [stdout] | [INFO] [stdout] 810 | assert!(cards < cards2 && cards2 > cards); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cards < cards2` [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] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/fifty_sixty.rs:824:17 [INFO] [stdout] | [INFO] [stdout] 824 | assert!(cards < cards2 && cards2 > cards); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cards < cards2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/forty_fifty.rs:16:28 [INFO] [stdout] | [INFO] [stdout] 16 | HashSet::from_iter(crate::arithmetic::small_primes(10_000_000).into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/collect.rs:152:20 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 16 - HashSet::from_iter(crate::arithmetic::small_primes(10_000_000).into_iter()); [INFO] [stdout] 16 + HashSet::from_iter(crate::arithmetic::small_primes(10_000_000)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&pan_number).is_some()` [INFO] [stdout] --> src/forty_fifty.rs:46:19 [INFO] [stdout] | [INFO] [stdout] 46 | if primes.get(&pan_number).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains(&pan_number)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&s).is_some()` [INFO] [stdout] --> src/forty_fifty.rs:59:38 [INFO] [stdout] | [INFO] [stdout] 59 | .filter(|s| triangle_numbers.get(&s).is_some()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace it with: `contains(&s)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/forty_fifty.rs:59:42 [INFO] [stdout] | [INFO] [stdout] 59 | .filter(|s| triangle_numbers.get(&s).is_some()) [INFO] [stdout] | ^^ help: change this to: `s` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/forty_fifty.rs:68:12 [INFO] [stdout] | [INFO] [stdout] 68 | if from_digits(&permutation[7..]) % 17 == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `from_digits(&permutation[7..]).is_multiple_of(17)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `reserve` immediately after creation [INFO] [stdout] --> src/eleven_twenty.rs:195:5 [INFO] [stdout] | [INFO] [stdout] 195 | / let mut result = vec![]; [INFO] [stdout] 196 | | result.reserve(100); [INFO] [stdout] | |________________________^ help: consider using `Vec::with_capacity(/* Space hint */)`: `let mut result = Vec::with_capacity(100);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#reserve_after_initialization [INFO] [stdout] = note: `#[warn(clippy::reserve_after_initialization)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/forty_fifty.rs:69:16 [INFO] [stdout] | [INFO] [stdout] 69 | && from_digits(&permutation[6..=8]) % 13 == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `from_digits(&permutation[6..=8]).is_multiple_of(13)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/forty_fifty.rs:70:16 [INFO] [stdout] | [INFO] [stdout] 70 | && from_digits(&permutation[5..=7]) % 11 == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `from_digits(&permutation[5..=7]).is_multiple_of(11)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/forty_fifty.rs:71:16 [INFO] [stdout] | [INFO] [stdout] 71 | && from_digits(&permutation[4..=6]) % 7 == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `from_digits(&permutation[4..=6]).is_multiple_of(7)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/forty_fifty.rs:72:16 [INFO] [stdout] | [INFO] [stdout] 72 | && from_digits(&permutation[3..=5]) % 5 == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `from_digits(&permutation[3..=5]).is_multiple_of(5)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/forty_fifty.rs:73:16 [INFO] [stdout] | [INFO] [stdout] 73 | && from_digits(&permutation[2..=4]) % 3 == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `from_digits(&permutation[2..=4]).is_multiple_of(3)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/forty_fifty.rs:74:16 [INFO] [stdout] | [INFO] [stdout] 74 | && from_digits(&permutation[1..=3]) % 2 == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `from_digits(&permutation[1..=3]).is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/eleven_twenty.rs:229:12 [INFO] [stdout] | [INFO] [stdout] 229 | if i % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^ help: replace with: `i.is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&diff).is_some()` [INFO] [stdout] --> src/forty_fifty.rs:89:32 [INFO] [stdout] | [INFO] [stdout] 89 | if pentagonals.get(&diff).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains(&diff)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&i.try_into().unwrap()).is_some()` [INFO] [stdout] --> src/forty_fifty.rs:170:23 [INFO] [stdout] | [INFO] [stdout] 170 | if primes_set.get(&i.try_into().unwrap()).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains(&i.try_into().unwrap())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/forty_fifty.rs:191:15 [INFO] [stdout] | [INFO] [stdout] 191 | } else if power % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace with: `power.is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/forty_fifty.rs:213:20 [INFO] [stdout] | [INFO] [stdout] 213 | for (i, p1) in (&primes).iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `primes` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&p3).is_none()` [INFO] [stdout] --> src/forty_fifty.rs:229:27 [INFO] [stdout] | [INFO] [stdout] 229 | if primes_set.get(&p3).is_none() { [INFO] [stdout] | -----------^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: replace it with: `!primes_set.contains(&p3)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/eleven_twenty.rs:426:8 [INFO] [stdout] | [INFO] [stdout] 426 | if year % 400 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace with: `year.is_multiple_of(400)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/eleven_twenty.rs:428:15 [INFO] [stdout] | [INFO] [stdout] 428 | } else if year % 100 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace with: `year.is_multiple_of(100)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/eleven_twenty.rs:430:15 [INFO] [stdout] | [INFO] [stdout] 430 | } else if year % 4 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace with: `year.is_multiple_of(4)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&sum2).is_some()` [INFO] [stdout] --> src/forty_fifty.rs:266:27 [INFO] [stdout] | [INFO] [stdout] 266 | if primes_set.get(&sum2).is_some() && len > max_len { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains(&sum2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/one_ten.rs:37:12 [INFO] [stdout] | [INFO] [stdout] 37 | if tmp % a == 0 { [INFO] [stdout] | ^^^^^^^^^^^^ help: replace with: `tmp.is_multiple_of(a)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u64` -> `u64`) [INFO] [stdout] --> src/fifty_sixty.rs:35:23 [INFO] [stdout] | [INFO] [stdout] 35 | sum + 10u64.pow((*i).try_into().unwrap()) as u64 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `10u64.pow((*i).try_into().unwrap())` [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: useless conversion to the same type: `usize` [INFO] [stdout] --> src/fifty_sixty.rs:73:26 [INFO] [stdout] | [INFO] [stdout] 73 | if self.take_n > n_digits.try_into().unwrap() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/fifty_sixty.rs:92:23 [INFO] [stdout] | [INFO] [stdout] 92 | while r == None { [INFO] [stdout] | ^^^^^^^^^ help: use `Option::is_none()` instead: `r.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u64` -> `u64`) [INFO] [stdout] --> src/one_ten.rs:91:19 [INFO] [stdout] | [INFO] [stdout] 91 | sum_of += (i as u64).pow(2); [INFO] [stdout] | ^^^^^^^^^^ help: try: `i` [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: unnecessary use of `get(&pp).is_none()` [INFO] [stdout] --> src/fifty_sixty.rs:151:45 [INFO] [stdout] | [INFO] [stdout] 151 | if pp > max_p || primes_set.get(&pp).is_none() { [INFO] [stdout] | -----------^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: replace it with: `!primes_set.contains(&pp)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] = note: `#[warn(clippy::unnecessary_get_then_check)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u64` -> `u64`) [INFO] [stdout] --> src/one_ten.rs:123:22 [INFO] [stdout] | [INFO] [stdout] 123 | let c2 = (a as u64).pow(2) + (b as u64).pow(2); [INFO] [stdout] | ^^^^^^^^^^ help: try: `a` [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 (`u64` -> `u64`) [INFO] [stdout] --> src/one_ten.rs:123:42 [INFO] [stdout] | [INFO] [stdout] 123 | let c2 = (a as u64).pow(2) + (b as u64).pow(2); [INFO] [stdout] | ^^^^^^^^^^ help: try: `b` [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: length comparison to zero [INFO] [stdout] --> src/sixty_seventy.rs:11:8 [INFO] [stdout] | [INFO] [stdout] 11 | if rest_indices.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `rest_indices.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/sixty_seventy.rs:23:43 [INFO] [stdout] | [INFO] [stdout] 23 | let numberals_index = indexes.get(&index).unwrap(); [INFO] [stdout] | ^^^^^^ help: change this to: `index` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `iter().cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable [INFO] [stdout] --> src/sixty_seventy.rs:26:51 [INFO] [stdout] | [INFO] [stdout] 26 | let mut subvalues: Vec<_> = values.iter().cloned().collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_cloned_collect [INFO] [stdout] = note: `#[warn(clippy::iter_cloned_collect)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/sixty_seventy.rs:33:48 [INFO] [stdout] | [INFO] [stdout] 33 | look(&subvalues, &new_indices, &indexes); [INFO] [stdout] | ^^^^^^^^ help: change this to: `indexes` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `u64` [INFO] [stdout] --> src/sixty_seventy.rs:46:24 [INFO] [stdout] | [INFO] [stdout] 46 | .entry((t / 100).try_into().unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `u64` [INFO] [stdout] --> src/sixty_seventy.rs:60:24 [INFO] [stdout] | [INFO] [stdout] 60 | .entry((t / 100).try_into().unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `u64` [INFO] [stdout] --> src/sixty_seventy.rs:74:24 [INFO] [stdout] | [INFO] [stdout] 74 | .entry((t / 100).try_into().unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> src/fifty_sixty.rs:288:1 [INFO] [stdout] | [INFO] [stdout] 288 | / impl PartialOrd for Card { [INFO] [stdout] 289 | | fn partial_cmp(&self, other: &Card) -> Option { [INFO] [stdout] 290 | | self.value.partial_cmp(&other.value) [INFO] [stdout] 291 | | } [INFO] [stdout] 292 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] = note: `#[warn(clippy::non_canonical_partial_ord_impl)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 289 - fn partial_cmp(&self, other: &Card) -> Option { [INFO] [stdout] 290 - self.value.partial_cmp(&other.value) [INFO] [stdout] 291 - } [INFO] [stdout] 289 + fn partial_cmp(&self, other: &Card) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `u64` [INFO] [stdout] --> src/sixty_seventy.rs:88:24 [INFO] [stdout] | [INFO] [stdout] 88 | .entry((t / 100).try_into().unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `u64` [INFO] [stdout] --> src/sixty_seventy.rs:102:24 [INFO] [stdout] | [INFO] [stdout] 102 | .entry((t / 100).try_into().unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `u64` [INFO] [stdout] --> src/sixty_seventy.rs:116:24 [INFO] [stdout] | [INFO] [stdout] 116 | .entry((t / 100).try_into().unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's values [INFO] [stdout] --> src/sixty_seventy.rs:133:28 [INFO] [stdout] | [INFO] [stdout] 133 | for (_, octogonals) in &octogonal_index { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] = note: `#[warn(clippy::for_kv_map)]` on by default [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 133 - for (_, octogonals) in &octogonal_index { [INFO] [stdout] 133 + for octogonals in octogonal_index.values() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/sixty_seventy.rs:244:12 [INFO] [stdout] | [INFO] [stdout] 244 | if period % 2 != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace with: `!period.is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/sixty_seventy.rs:265:5 [INFO] [stdout] | [INFO] [stdout] 265 | return (last_d.unwrap_or(n.clone()), n); [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] 265 - return (last_d.unwrap_or(n.clone()), n); [INFO] [stdout] 265 + (last_d.unwrap_or(n.clone()), n) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&i).is_some()` [INFO] [stdout] --> src/sixty_seventy.rs:316:20 [INFO] [stdout] | [INFO] [stdout] 316 | if squares.get(&i).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace it with: `contains(&i)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&number).is_some()` [INFO] [stdout] --> src/fifty_sixty.rs:529:27 [INFO] [stdout] | [INFO] [stdout] 529 | if primes_set.get(&number).is_some() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains(&number)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `reserve` immediately after creation [INFO] [stdout] --> src/fifty_sixty.rs:546:5 [INFO] [stdout] | [INFO] [stdout] 546 | / let mut v = vec![]; [INFO] [stdout] 547 | | v.reserve(string.len()); [INFO] [stdout] | |____________________________^ help: consider using `Vec::with_capacity(/* Space hint */)`: `let mut v = Vec::with_capacity(string.len());` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#reserve_after_initialization [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `chunk.get(0)` [INFO] [stdout] --> src/fifty_sixty.rs:551:26 [INFO] [stdout] | [INFO] [stdout] 551 | if let Some(x) = chunk.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `chunk.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&n).is_none()` [INFO] [stdout] --> src/fifty_sixty.rs:624:31 [INFO] [stdout] | [INFO] [stdout] 624 | if primes_set.get(&n).is_none() { [INFO] [stdout] | -----------^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: replace it with: `!primes_set.contains(&n)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&n).is_none()` [INFO] [stdout] --> src/fifty_sixty.rs:633:31 [INFO] [stdout] | [INFO] [stdout] 633 | if primes_set.get(&n).is_none() { [INFO] [stdout] | -----------^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: replace it with: `!primes_set.contains(&n)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/sixty_seventy.rs:413:26 [INFO] [stdout] | [INFO] [stdout] 413 | .map(|n| if *n < 10 { vec![*n] } else { vec![1, 0] }) [INFO] [stdout] | __________________________^ [INFO] [stdout] 414 | | .flatten() [INFO] [stdout] | |__________________________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|n| if *n < 10 { vec![*n] } else { vec![1, 0] })` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `phi` [INFO] [stdout] --> src/sixty_seventy.rs:429:14 [INFO] [stdout] | [INFO] [stdout] 429 | for i in 1..LIMIT { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 429 - for i in 1..LIMIT { [INFO] [stdout] 429 + for (i, ) in phi.iter_mut().enumerate().take(LIMIT).skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/forty_fifty.rs:16:28 [INFO] [stdout] | [INFO] [stdout] 16 | HashSet::from_iter(crate::arithmetic::small_primes(10_000_000).into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/collect.rs:152:20 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 16 - HashSet::from_iter(crate::arithmetic::small_primes(10_000_000).into_iter()); [INFO] [stdout] 16 + HashSet::from_iter(crate::arithmetic::small_primes(10_000_000)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&pan_number).is_some()` [INFO] [stdout] --> src/forty_fifty.rs:46:19 [INFO] [stdout] | [INFO] [stdout] 46 | if primes.get(&pan_number).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains(&pan_number)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `phi` [INFO] [stdout] --> src/sixty_seventy.rs:452:14 [INFO] [stdout] | [INFO] [stdout] 452 | for i in 1..LIMIT { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 452 - for i in 1..LIMIT { [INFO] [stdout] 452 + for (i, ) in phi.iter_mut().enumerate().take(LIMIT).skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&s).is_some()` [INFO] [stdout] --> src/forty_fifty.rs:59:38 [INFO] [stdout] | [INFO] [stdout] 59 | .filter(|s| triangle_numbers.get(&s).is_some()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace it with: `contains(&s)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/forty_fifty.rs:59:42 [INFO] [stdout] | [INFO] [stdout] 59 | .filter(|s| triangle_numbers.get(&s).is_some()) [INFO] [stdout] | ^^ help: change this to: `s` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/forty_fifty.rs:68:12 [INFO] [stdout] | [INFO] [stdout] 68 | if from_digits(&permutation[7..]) % 17 == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `from_digits(&permutation[7..]).is_multiple_of(17)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/forty_fifty.rs:69:16 [INFO] [stdout] | [INFO] [stdout] 69 | && from_digits(&permutation[6..=8]) % 13 == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `from_digits(&permutation[6..=8]).is_multiple_of(13)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/forty_fifty.rs:70:16 [INFO] [stdout] | [INFO] [stdout] 70 | && from_digits(&permutation[5..=7]) % 11 == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `from_digits(&permutation[5..=7]).is_multiple_of(11)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/forty_fifty.rs:71:16 [INFO] [stdout] | [INFO] [stdout] 71 | && from_digits(&permutation[4..=6]) % 7 == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `from_digits(&permutation[4..=6]).is_multiple_of(7)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/forty_fifty.rs:72:16 [INFO] [stdout] | [INFO] [stdout] 72 | && from_digits(&permutation[3..=5]) % 5 == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `from_digits(&permutation[3..=5]).is_multiple_of(5)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/forty_fifty.rs:73:16 [INFO] [stdout] | [INFO] [stdout] 73 | && from_digits(&permutation[2..=4]) % 3 == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `from_digits(&permutation[2..=4]).is_multiple_of(3)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/forty_fifty.rs:74:16 [INFO] [stdout] | [INFO] [stdout] 74 | && from_digits(&permutation[1..=3]) % 2 == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `from_digits(&permutation[1..=3]).is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `reserve` immediately after creation [INFO] [stdout] --> src/thirty_forty.rs:110:5 [INFO] [stdout] | [INFO] [stdout] 110 | / let mut fractions: Vec<(u32, u32)> = vec![]; [INFO] [stdout] 111 | | fractions.reserve(4); [INFO] [stdout] | |_________________________^ help: consider using `Vec::with_capacity(/* Space hint */)`: `let mut fractions: Vec<(u32, u32)> = Vec::with_capacity(4);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#reserve_after_initialization [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&diff).is_some()` [INFO] [stdout] --> src/forty_fifty.rs:89:32 [INFO] [stdout] | [INFO] [stdout] 89 | if pentagonals.get(&diff).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains(&diff)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/thirty_forty.rs:169:28 [INFO] [stdout] | [INFO] [stdout] 169 | HashSet::from_iter(crate::arithmetic::small_primes(1_000_000).into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/collect.rs:152:20 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 169 - HashSet::from_iter(crate::arithmetic::small_primes(1_000_000).into_iter()); [INFO] [stdout] 169 + HashSet::from_iter(crate::arithmetic::small_primes(1_000_000)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&i.try_into().unwrap()).is_some()` [INFO] [stdout] --> src/forty_fifty.rs:170:23 [INFO] [stdout] | [INFO] [stdout] 170 | if primes_set.get(&i.try_into().unwrap()).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains(&i.try_into().unwrap())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&number).is_none()` [INFO] [stdout] --> src/thirty_forty.rs:177:23 [INFO] [stdout] | [INFO] [stdout] 177 | if primes.get(&number).is_none() { [INFO] [stdout] | -------^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: replace it with: `!primes.contains(&number)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/forty_fifty.rs:191:15 [INFO] [stdout] | [INFO] [stdout] 191 | } else if power % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace with: `power.is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/thirty_forty.rs:217:28 [INFO] [stdout] | [INFO] [stdout] 217 | HashSet::from_iter(crate::arithmetic::small_primes(1_000_000).into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/collect.rs:152:20 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 217 - HashSet::from_iter(crate::arithmetic::small_primes(1_000_000).into_iter()); [INFO] [stdout] 217 + HashSet::from_iter(crate::arithmetic::small_primes(1_000_000)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `u64` [INFO] [stdout] --> src/thirty_forty.rs:220:27 [INFO] [stdout] | [INFO] [stdout] 220 | let digs = digits((*p).try_into().unwrap()).in_order(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/forty_fifty.rs:213:20 [INFO] [stdout] | [INFO] [stdout] 213 | for (i, p1) in (&primes).iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `primes` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&from_digits(&digs[0..i])).is_none()` [INFO] [stdout] --> src/thirty_forty.rs:226:23 [INFO] [stdout] | [INFO] [stdout] 226 | if primes.get(&from_digits(&digs[0..i])).is_none() { [INFO] [stdout] | -------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: replace it with: `!primes.contains(&from_digits(&digs[0..i]))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&from_digits(&digs[i..])).is_none()` [INFO] [stdout] --> src/thirty_forty.rs:231:23 [INFO] [stdout] | [INFO] [stdout] 231 | if primes.get(&from_digits(&digs[i..])).is_none() { [INFO] [stdout] | -------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: replace it with: `!primes.contains(&from_digits(&digs[i..]))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&p3).is_none()` [INFO] [stdout] --> src/forty_fifty.rs:229:27 [INFO] [stdout] | [INFO] [stdout] 229 | if primes_set.get(&p3).is_none() { [INFO] [stdout] | -----------^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: replace it with: `!primes_set.contains(&p3)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&sum2).is_some()` [INFO] [stdout] --> src/forty_fifty.rs:266:27 [INFO] [stdout] | [INFO] [stdout] 266 | if primes_set.get(&sum2).is_some() && len > max_len { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains(&sum2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/one_ten.rs:37:12 [INFO] [stdout] | [INFO] [stdout] 37 | if tmp % a == 0 { [INFO] [stdout] | ^^^^^^^^^^^^ help: replace with: `tmp.is_multiple_of(a)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u8` -> `u8`) [INFO] [stdout] --> src/thirty_forty.rs:301:57 [INFO] [stdout] | [INFO] [stdout] 301 | self.digits = digits(self.n.into()).map(|i| i as u8).collect::>() [INFO] [stdout] | ^^^^^^^ help: try: `i` [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 (`u64` -> `u64`) [INFO] [stdout] --> src/one_ten.rs:91:19 [INFO] [stdout] | [INFO] [stdout] 91 | sum_of += (i as u64).pow(2); [INFO] [stdout] | ^^^^^^^^^^ help: try: `i` [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: call to `reserve` immediately after creation [INFO] [stdout] --> src/twenty_thirty.rs:54:5 [INFO] [stdout] | [INFO] [stdout] 54 | / let mut abundants: Vec = vec![]; [INFO] [stdout] 55 | | abundants.reserve(30_000); [INFO] [stdout] | |______________________________^ help: consider using `Vec::with_capacity(/* Space hint */)`: `let mut abundants: Vec = Vec::with_capacity(30_000);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#reserve_after_initialization [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u64` -> `u64`) [INFO] [stdout] --> src/one_ten.rs:123:22 [INFO] [stdout] | [INFO] [stdout] 123 | let c2 = (a as u64).pow(2) + (b as u64).pow(2); [INFO] [stdout] | ^^^^^^^^^^ help: try: `a` [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 (`u64` -> `u64`) [INFO] [stdout] --> src/one_ten.rs:123:42 [INFO] [stdout] | [INFO] [stdout] 123 | let c2 = (a as u64).pow(2) + (b as u64).pow(2); [INFO] [stdout] | ^^^^^^^^^^ help: try: `b` [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: length comparison to zero [INFO] [stdout] --> src/sixty_seventy.rs:11:8 [INFO] [stdout] | [INFO] [stdout] 11 | if rest_indices.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `rest_indices.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/sixty_seventy.rs:23:43 [INFO] [stdout] | [INFO] [stdout] 23 | let numberals_index = indexes.get(&index).unwrap(); [INFO] [stdout] | ^^^^^^ help: change this to: `index` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `iter().cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable [INFO] [stdout] --> src/sixty_seventy.rs:26:51 [INFO] [stdout] | [INFO] [stdout] 26 | let mut subvalues: Vec<_> = values.iter().cloned().collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_cloned_collect [INFO] [stdout] = note: `#[warn(clippy::iter_cloned_collect)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/sixty_seventy.rs:33:48 [INFO] [stdout] | [INFO] [stdout] 33 | look(&subvalues, &new_indices, &indexes); [INFO] [stdout] | ^^^^^^^^ help: change this to: `indexes` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `u64` [INFO] [stdout] --> src/sixty_seventy.rs:46:24 [INFO] [stdout] | [INFO] [stdout] 46 | .entry((t / 100).try_into().unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `u64` [INFO] [stdout] --> src/sixty_seventy.rs:60:24 [INFO] [stdout] | [INFO] [stdout] 60 | .entry((t / 100).try_into().unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `u64` [INFO] [stdout] --> src/sixty_seventy.rs:74:24 [INFO] [stdout] | [INFO] [stdout] 74 | .entry((t / 100).try_into().unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `u64` [INFO] [stdout] --> src/sixty_seventy.rs:88:24 [INFO] [stdout] | [INFO] [stdout] 88 | .entry((t / 100).try_into().unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `u64` [INFO] [stdout] --> src/sixty_seventy.rs:102:24 [INFO] [stdout] | [INFO] [stdout] 102 | .entry((t / 100).try_into().unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `u64` [INFO] [stdout] --> src/sixty_seventy.rs:116:24 [INFO] [stdout] | [INFO] [stdout] 116 | .entry((t / 100).try_into().unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of a fallible conversion when an infallible one could be used [INFO] [stdout] --> src/twenty_thirty.rs:257:54 [INFO] [stdout] | [INFO] [stdout] 257 | let d: u64 = c.to_digit(10).unwrap().try_into().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: converting `u32` to `u64` cannot fail [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fallible_conversions)]` on by default [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 257 - let d: u64 = c.to_digit(10).unwrap().try_into().unwrap(); [INFO] [stdout] 257 + let d: u64 = c.to_digit(10).unwrap().into(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's values [INFO] [stdout] --> src/sixty_seventy.rs:133:28 [INFO] [stdout] | [INFO] [stdout] 133 | for (_, octogonals) in &octogonal_index { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] = note: `#[warn(clippy::for_kv_map)]` on by default [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 133 - for (_, octogonals) in &octogonal_index { [INFO] [stdout] 133 + for octogonals in octogonal_index.values() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/sixty_seventy.rs:244:12 [INFO] [stdout] | [INFO] [stdout] 244 | if period % 2 != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace with: `!period.is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/sixty_seventy.rs:265:5 [INFO] [stdout] | [INFO] [stdout] 265 | return (last_d.unwrap_or(n.clone()), n); [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] 265 - return (last_d.unwrap_or(n.clone()), n); [INFO] [stdout] 265 + (last_d.unwrap_or(n.clone()), n) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&i).is_some()` [INFO] [stdout] --> src/sixty_seventy.rs:316:20 [INFO] [stdout] | [INFO] [stdout] 316 | if squares.get(&i).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace it with: `contains(&i)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/sixty_seventy.rs:413:26 [INFO] [stdout] | [INFO] [stdout] 413 | .map(|n| if *n < 10 { vec![*n] } else { vec![1, 0] }) [INFO] [stdout] | __________________________^ [INFO] [stdout] 414 | | .flatten() [INFO] [stdout] | |__________________________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|n| if *n < 10 { vec![*n] } else { vec![1, 0] })` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `phi` [INFO] [stdout] --> src/sixty_seventy.rs:429:14 [INFO] [stdout] | [INFO] [stdout] 429 | for i in 1..LIMIT { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 429 - for i in 1..LIMIT { [INFO] [stdout] 429 + for (i, ) in phi.iter_mut().enumerate().take(LIMIT).skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `phi` [INFO] [stdout] --> src/sixty_seventy.rs:452:14 [INFO] [stdout] | [INFO] [stdout] 452 | for i in 1..LIMIT { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 452 - for i in 1..LIMIT { [INFO] [stdout] 452 + for (i, ) in phi.iter_mut().enumerate().take(LIMIT).skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `reserve` immediately after creation [INFO] [stdout] --> src/thirty_forty.rs:110:5 [INFO] [stdout] | [INFO] [stdout] 110 | / let mut fractions: Vec<(u32, u32)> = vec![]; [INFO] [stdout] 111 | | fractions.reserve(4); [INFO] [stdout] | |_________________________^ help: consider using `Vec::with_capacity(/* Space hint */)`: `let mut fractions: Vec<(u32, u32)> = Vec::with_capacity(4);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#reserve_after_initialization [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/thirty_forty.rs:169:28 [INFO] [stdout] | [INFO] [stdout] 169 | HashSet::from_iter(crate::arithmetic::small_primes(1_000_000).into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/collect.rs:152:20 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 169 - HashSet::from_iter(crate::arithmetic::small_primes(1_000_000).into_iter()); [INFO] [stdout] 169 + HashSet::from_iter(crate::arithmetic::small_primes(1_000_000)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&number).is_none()` [INFO] [stdout] --> src/thirty_forty.rs:177:23 [INFO] [stdout] | [INFO] [stdout] 177 | if primes.get(&number).is_none() { [INFO] [stdout] | -------^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: replace it with: `!primes.contains(&number)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/thirty_forty.rs:217:28 [INFO] [stdout] | [INFO] [stdout] 217 | HashSet::from_iter(crate::arithmetic::small_primes(1_000_000).into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/collect.rs:152:20 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 217 - HashSet::from_iter(crate::arithmetic::small_primes(1_000_000).into_iter()); [INFO] [stdout] 217 + HashSet::from_iter(crate::arithmetic::small_primes(1_000_000)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `u64` [INFO] [stdout] --> src/thirty_forty.rs:220:27 [INFO] [stdout] | [INFO] [stdout] 220 | let digs = digits((*p).try_into().unwrap()).in_order(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&from_digits(&digs[0..i])).is_none()` [INFO] [stdout] --> src/thirty_forty.rs:226:23 [INFO] [stdout] | [INFO] [stdout] 226 | if primes.get(&from_digits(&digs[0..i])).is_none() { [INFO] [stdout] | -------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: replace it with: `!primes.contains(&from_digits(&digs[0..i]))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&from_digits(&digs[i..])).is_none()` [INFO] [stdout] --> src/thirty_forty.rs:231:23 [INFO] [stdout] | [INFO] [stdout] 231 | if primes.get(&from_digits(&digs[i..])).is_none() { [INFO] [stdout] | -------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: replace it with: `!primes.contains(&from_digits(&digs[i..]))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u8` -> `u8`) [INFO] [stdout] --> src/thirty_forty.rs:301:57 [INFO] [stdout] | [INFO] [stdout] 301 | self.digits = digits(self.n.into()).map(|i| i as u8).collect::>() [INFO] [stdout] | ^^^^^^^ help: try: `i` [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: call to `reserve` immediately after creation [INFO] [stdout] --> src/twenty_thirty.rs:54:5 [INFO] [stdout] | [INFO] [stdout] 54 | / let mut abundants: Vec = vec![]; [INFO] [stdout] 55 | | abundants.reserve(30_000); [INFO] [stdout] | |______________________________^ help: consider using `Vec::with_capacity(/* Space hint */)`: `let mut abundants: Vec = Vec::with_capacity(30_000);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#reserve_after_initialization [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of a fallible conversion when an infallible one could be used [INFO] [stdout] --> src/twenty_thirty.rs:257:54 [INFO] [stdout] | [INFO] [stdout] 257 | let d: u64 = c.to_digit(10).unwrap().try_into().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: converting `u32` to `u64` cannot fail [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fallible_conversions)]` on by default [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 257 - let d: u64 = c.to_digit(10).unwrap().try_into().unwrap(); [INFO] [stdout] 257 + let d: u64 = c.to_digit(10).unwrap().into(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 10.96s [INFO] running `Command { std: "docker" "inspect" "62fef9c574f91b20f588805936c7c3b518306120d766dc02585dd187f68266c6", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "62fef9c574f91b20f588805936c7c3b518306120d766dc02585dd187f68266c6", kill_on_drop: false }` [INFO] [stdout] 62fef9c574f91b20f588805936c7c3b518306120d766dc02585dd187f68266c6