[INFO] fetching crate designguard 0.1.1... [INFO] linting designguard-0.1.1 against nightly for clippy-nonminimal_bool-denied [INFO] extracting crate designguard 0.1.1 into /workspace/builds/worker-7-tc1/source [INFO] started tweaking crates.io crate designguard 0.1.1 [INFO] removed 0 missing examples [INFO] removed 0 missing tests [INFO] finished tweaking crates.io crate designguard 0.1.1 [INFO] tweaked toml for crates.io crate designguard 0.1.1 written to /workspace/builds/worker-7-tc1/source/Cargo.toml [INFO] validating manifest of crates.io crate designguard 0.1.1 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 crates.io crate designguard 0.1.1 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] Blocking waiting for file lock on package cache [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-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] 4e770aa1fd4ad318da153b53d5a11cfa997f2a1555c030317e83e07b49f1c26d [INFO] running `Command { std: "docker" "start" "-a" "4e770aa1fd4ad318da153b53d5a11cfa997f2a1555c030317e83e07b49f1c26d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "4e770aa1fd4ad318da153b53d5a11cfa997f2a1555c030317e83e07b49f1c26d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "4e770aa1fd4ad318da153b53d5a11cfa997f2a1555c030317e83e07b49f1c26d", kill_on_drop: false }` [INFO] [stdout] 4e770aa1fd4ad318da153b53d5a11cfa997f2a1555c030317e83e07b49f1c26d [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-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] 701b41f9894d0504470024c6ef1c2a8823a0afd92c2994bd374a8b7b8f33095d [INFO] running `Command { std: "docker" "start" "-a" "701b41f9894d0504470024c6ef1c2a8823a0afd92c2994bd374a8b7b8f33095d", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.106 [INFO] [stderr] Compiling serde_core v1.0.228 [INFO] [stderr] Compiling cc v1.2.55 [INFO] [stderr] Checking futures-core v0.3.31 [INFO] [stderr] Checking untrusted v0.9.0 [INFO] [stderr] Checking errno v0.3.14 [INFO] [stderr] Checking parking_lot_core v0.9.12 [INFO] [stderr] Checking mio v1.1.1 [INFO] [stderr] Checking socket2 v0.6.2 [INFO] [stderr] Checking getrandom v0.2.17 [INFO] [stderr] Compiling zmij v1.0.19 [INFO] [stderr] Checking futures-task v0.3.31 [INFO] [stderr] Compiling rustls v0.21.12 [INFO] [stderr] Compiling zerocopy v0.8.39 [INFO] [stderr] Compiling native-tls v0.2.14 [INFO] [stderr] Checking http-body v0.4.6 [INFO] [stderr] Checking socket2 v0.5.10 [INFO] [stderr] Checking clap_lex v0.7.7 [INFO] [stderr] Checking futures-util v0.3.31 [INFO] [stderr] Checking signal-hook-registry v1.4.8 [INFO] [stderr] Checking futures-channel v0.3.31 [INFO] [stderr] Compiling anyhow v1.0.101 [INFO] [stderr] Checking regex-syntax v0.8.9 [INFO] [stderr] Checking webpki-roots v0.25.4 [INFO] [stderr] Checking parking_lot v0.12.5 [INFO] [stderr] Checking fixedbitset v0.4.2 [INFO] [stderr] Checking uuid v1.20.0 [INFO] [stderr] Checking is-terminal v0.4.17 [INFO] [stderr] Checking clap_builder v4.5.57 [INFO] [stderr] Checking tempfile v3.24.0 [INFO] [stderr] Compiling quote v1.0.44 [INFO] [stderr] Checking regex-automata v0.4.14 [INFO] [stderr] Compiling syn v2.0.114 [INFO] [stderr] Compiling ring v0.17.14 [INFO] [stderr] Compiling openssl-sys v0.9.111 [INFO] [stderr] Compiling openssl v0.10.75 [INFO] [stderr] Checking regex v1.12.3 [INFO] [stderr] Checking clap v4.5.57 [INFO] [stderr] Checking serde_json v1.0.149 [INFO] [stderr] Checking rustls-webpki v0.101.7 [INFO] [stderr] Checking sct v0.7.1 [INFO] [stderr] Compiling synstructure v0.13.2 [INFO] [stderr] Compiling zerovec-derive v0.11.2 [INFO] [stderr] Compiling displaydoc v0.2.5 [INFO] [stderr] Compiling tokio-macros v2.6.0 [INFO] [stderr] Compiling serde_derive v1.0.228 [INFO] [stderr] Compiling tracing-attributes v0.1.31 [INFO] [stderr] Compiling openssl-macros v0.1.1 [INFO] [stderr] Compiling zerocopy-derive v0.8.39 [INFO] [stderr] Compiling thiserror-impl v1.0.69 [INFO] [stderr] Compiling async-trait v0.1.89 [INFO] [stderr] Compiling zerofrom-derive v0.1.6 [INFO] [stderr] Compiling yoke-derive v0.8.1 [INFO] [stderr] Checking tokio v1.49.0 [INFO] [stderr] Checking zerofrom v0.1.6 [INFO] [stderr] Checking yoke v0.8.1 [INFO] [stderr] Checking thiserror v1.0.69 [INFO] [stderr] Checking tracing v0.1.44 [INFO] [stderr] Checking zerovec v0.11.5 [INFO] [stderr] Checking zerotrie v0.2.3 [INFO] [stderr] Checking tinystr v0.8.2 [INFO] [stderr] Checking potential_utf v0.1.4 [INFO] [stderr] Checking icu_collections v2.1.1 [INFO] [stderr] Checking icu_locale_core v2.1.1 [INFO] [stderr] Checking serde v1.0.228 [INFO] [stderr] Checking icu_provider v2.1.1 [INFO] [stderr] Checking icu_properties v2.1.2 [INFO] [stderr] Checking icu_normalizer v2.1.1 [INFO] [stderr] Checking serde_urlencoded v0.7.1 [INFO] [stderr] Checking petgraph v0.6.5 [INFO] [stderr] Checking tinytemplate v1.2.1 [INFO] [stderr] Checking chrono v0.4.43 [INFO] [stderr] Checking idna_adapter v1.2.1 [INFO] [stderr] Checking idna v1.1.0 [INFO] [stderr] Checking url v2.5.8 [INFO] [stderr] Checking tokio-util v0.7.18 [INFO] [stderr] Checking tokio-native-tls v0.3.1 [INFO] [stderr] Checking tokio-rustls v0.24.1 [INFO] [stderr] Checking half v2.7.1 [INFO] [stderr] Checking h2 v0.3.27 [INFO] [stderr] Checking ciborium-ll v0.2.2 [INFO] [stderr] Checking ciborium v0.2.2 [INFO] [stderr] Checking criterion v0.5.1 [INFO] [stderr] Checking hyper v0.14.32 [INFO] [stderr] Checking hyper-rustls v0.24.2 [INFO] [stderr] Checking hyper-tls v0.5.0 [INFO] [stderr] Checking reqwest v0.11.27 [INFO] [stderr] Checking designguard v0.1.1 (/opt/rustwide/workdir) [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/analyzer/rules.rs:227:25 [INFO] [stdout] | [INFO] [stdout] 227 | / if unit == "nF" && value >= 80.0 && value <= 120.0 { [INFO] [stdout] 228 | | if is_nearby(component, &ic.position, 20.0) { [INFO] [stdout] 229 | | found_cap = true; [INFO] [stdout] 230 | | break; [INFO] [stdout] 231 | | } [INFO] [stdout] 232 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 227 ~ if unit == "nF" && value >= 80.0 && value <= 120.0 [INFO] [stdout] 228 ~ && is_nearby(component, &ic.position, 20.0) { [INFO] [stdout] 229 | found_cap = true; [INFO] [stdout] 230 | break; [INFO] [stdout] 231 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/analyzer/rules.rs:227:44 [INFO] [stdout] | [INFO] [stdout] 227 | if unit == "nF" && value >= 80.0 && value <= 120.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(80.0..=120.0).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] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/analyzer/rules.rs:391:32 [INFO] [stdout] | [INFO] [stdout] 391 | ... if value_ohm >= 2200.0 && value_ohm <= 10000.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(2200.0..=10000.0).contains(&value_ohm)` [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 `if` statement can be collapsed [INFO] [stdout] --> src/analyzer/rules.rs:456:25 [INFO] [stdout] | [INFO] [stdout] 456 | / if unit == "pF" && value >= 10.0 && value <= 33.0 { [INFO] [stdout] 457 | | if is_nearby(component, &crystal.position, 30.0) { [INFO] [stdout] 458 | | capacitor_count += 1; [INFO] [stdout] 459 | | capacitors_found.push(component.reference.clone()); [INFO] [stdout] 460 | | } [INFO] [stdout] 461 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 456 ~ if unit == "pF" && value >= 10.0 && value <= 33.0 [INFO] [stdout] 457 ~ && is_nearby(component, &crystal.position, 30.0) { [INFO] [stdout] 458 | capacitor_count += 1; [INFO] [stdout] 459 | capacitors_found.push(component.reference.clone()); [INFO] [stdout] 460 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/analyzer/rules.rs:456:44 [INFO] [stdout] | [INFO] [stdout] 456 | if unit == "pF" && value >= 10.0 && value <= 33.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(10.0..=33.0).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 `if` statement can be collapsed [INFO] [stdout] --> src/analyzer/rules.rs:896:25 [INFO] [stdout] | [INFO] [stdout] 896 | / if value_u_f >= 10.0 && value_u_f <= 100.0 { [INFO] [stdout] 897 | | if is_nearby(component, ®ulator.position, 30.0) { [INFO] [stdout] 898 | | found_bulk_cap = true; [INFO] [stdout] 899 | | break; [INFO] [stdout] 900 | | } [INFO] [stdout] 901 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 896 ~ if value_u_f >= 10.0 && value_u_f <= 100.0 [INFO] [stdout] 897 ~ && is_nearby(component, ®ulator.position, 30.0) { [INFO] [stdout] 898 | found_bulk_cap = true; [INFO] [stdout] 899 | break; [INFO] [stdout] 900 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/analyzer/rules.rs:896:28 [INFO] [stdout] | [INFO] [stdout] 896 | if value_u_f >= 10.0 && value_u_f <= 100.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(10.0..=100.0).contains(&value_u_f)` [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: clamp-like pattern without using clamp function [INFO] [stdout] --> src/analyzer/drs.rs:389:26 [INFO] [stdout] | [INFO] [stdout] 389 | let risk_index = (proximity_penalty + inductance_penalty + mismatch_penalty) [INFO] [stdout] | __________________________^ [INFO] [stdout] 390 | | .min(100.0) [INFO] [stdout] 391 | | .max(0.0); [INFO] [stdout] | |_____________________^ help: replace with clamp: `(proximity_penalty + inductance_penalty + mismatch_penalty).clamp(0.0, 100.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] = note: `#[warn(clippy::manual_clamp)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/analyzer/drs.rs:712:17 [INFO] [stdout] | [INFO] [stdout] 712 | / if ref_name.starts_with('C') || ref_name.starts_with('c') { [INFO] [stdout] 713 | | if other_footprint.uuid != footprint.uuid { [INFO] [stdout] 714 | | for pad in &other_footprint.pads { [INFO] [stdout] 715 | | if pad.net == Some(via.net) { [INFO] [stdout] ... | [INFO] [stdout] 723 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 712 ~ if (ref_name.starts_with('C') || ref_name.starts_with('c')) { [INFO] [stdout] 713 ~ && other_footprint.uuid != footprint.uuid { [INFO] [stdout] 714 | for pad in &other_footprint.pads { [INFO] [stdout] ... [INFO] [stdout] 721 | } [INFO] [stdout] 722 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/analyzer/drs.rs:1001:23 [INFO] [stdout] | [INFO] [stdout] 1001 | let cap_pad = cap_footprint.pads.iter() [INFO] [stdout] | _______________________^ [INFO] [stdout] 1002 | | .find(|p| p.net == Some(net_id) || p.net_name.as_ref().map(|n| n == net_name).unwrap_or(false)) [INFO] [stdout] 1003 | | .ok_or_else(|| PathError::InvalidNetConnection)?; [INFO] [stdout] | |___________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `ok_or` instead [INFO] [stdout] | [INFO] [stdout] 1003 - .ok_or_else(|| PathError::InvalidNetConnection)?; [INFO] [stdout] 1003 + .ok_or(PathError::InvalidNetConnection)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/analyzer/drs.rs:1006:22 [INFO] [stdout] | [INFO] [stdout] 1006 | let ic_pad = ic_footprint.pads.iter() [INFO] [stdout] | ______________________^ [INFO] [stdout] 1007 | | .find(|p| p.net == Some(net_id) || p.net_name.as_ref().map(|n| n == net_name).unwrap_or(false)) [INFO] [stdout] 1008 | | .ok_or_else(|| PathError::InvalidNetConnection)?; [INFO] [stdout] | |___________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `ok_or` instead [INFO] [stdout] | [INFO] [stdout] 1008 - .ok_or_else(|| PathError::InvalidNetConnection)?; [INFO] [stdout] 1008 + .ok_or(PathError::InvalidNetConnection)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/analyzer/drs.rs:1122:49 [INFO] [stdout] | [INFO] [stdout] 1122 | graph.entry(start_node.clone()).or_insert_with(Vec::new).push(end_node.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/analyzer/drs.rs:1123:39 [INFO] [stdout] | [INFO] [stdout] 1123 | graph.entry(end_node).or_insert_with(Vec::new).push(start_node); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/analyzer/drs.rs:1149:59 [INFO] [stdout] | [INFO] [stdout] 1149 | ... graph.entry(via_node.clone()).or_insert_with(Vec::new).push(trace_node.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/analyzer/drs.rs:1150:53 [INFO] [stdout] | [INFO] [stdout] 1150 | ... graph.entry(trace_node).or_insert_with(Vec::new).push(via_node); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/analyzer/drs.rs:1164:59 [INFO] [stdout] | [INFO] [stdout] 1164 | ... graph.entry(via_node.clone()).or_insert_with(Vec::new).push(trace_node.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/analyzer/drs.rs:1165:53 [INFO] [stdout] | [INFO] [stdout] 1165 | ... graph.entry(trace_node).or_insert_with(Vec::new).push(via_node); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/analyzer/drs.rs:1190:60 [INFO] [stdout] | [INFO] [stdout] 1190 | ... graph.entry(zone_node.clone()).or_insert_with(Vec::new).push(trace_node.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/analyzer/drs.rs:1191:53 [INFO] [stdout] | [INFO] [stdout] 1191 | ... graph.entry(trace_node).or_insert_with(Vec::new).push(zone_node); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/analyzer/drs.rs:1204:60 [INFO] [stdout] | [INFO] [stdout] 1204 | ... graph.entry(zone_node.clone()).or_insert_with(Vec::new).push(trace_node.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/analyzer/drs.rs:1205:53 [INFO] [stdout] | [INFO] [stdout] 1205 | ... graph.entry(trace_node).or_insert_with(Vec::new).push(zone_node); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/analyzer/capacitor_classifier.rs:136:12 [INFO] [stdout] | [INFO] [stdout] 136 | if value_pf < 1.0 || value_pf > 47.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!(1.0..=47.0).contains(&value_pf)` [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/analyzer/capacitor_classifier.rs:168:69 [INFO] [stdout] | [INFO] [stdout] 168 | if (has_xtal_net && has_gnd) || (near_crystal && has_gnd && value_pf >= 10.0 && value_pf <= 33.0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(10.0..=33.0).contains(&value_pf)` [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/analyzer/capacitor_classifier.rs:214:12 [INFO] [stdout] | [INFO] [stdout] 214 | if (has_switch_node && has_gnd) || (near_switch && has_gnd) { [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] 214 - if (has_switch_node && has_gnd) || (near_switch && has_gnd) { [INFO] [stdout] 214 + if !(!has_gnd || !has_switch_node && !near_switch) { [INFO] [stdout] | [INFO] [stdout] 214 - if (has_switch_node && has_gnd) || (near_switch && has_gnd) { [INFO] [stdout] 214 + if (near_switch || has_switch_node) && has_gnd { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/analyzer/capacitor_classifier.rs:221:28 [INFO] [stdout] | [INFO] [stdout] 221 | reasoning: format!("Snubber: connected to switch node or near MOSFET/inductor"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Snubber: connected to switch node or near MOSFET/inductor".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: this `impl` can be derived [INFO] [stdout] --> src/compliance/net_classifier.rs:95:1 [INFO] [stdout] | [INFO] [stdout] 95 | / impl Default for NetClassifier { [INFO] [stdout] 96 | | fn default() -> Self { [INFO] [stdout] 97 | | Self { [INFO] [stdout] 98 | | custom_high_speed: Vec::new(), [INFO] [stdout] ... | [INFO] [stdout] 105 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 82 + #[derive(Default)] [INFO] [stdout] 83 | pub struct NetClassifier { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/analyzer/rules.rs:227:25 [INFO] [stdout] | [INFO] [stdout] 227 | / if unit == "nF" && value >= 80.0 && value <= 120.0 { [INFO] [stdout] 228 | | if is_nearby(component, &ic.position, 20.0) { [INFO] [stdout] 229 | | found_cap = true; [INFO] [stdout] 230 | | break; [INFO] [stdout] 231 | | } [INFO] [stdout] 232 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 227 ~ if unit == "nF" && value >= 80.0 && value <= 120.0 [INFO] [stdout] 228 ~ && is_nearby(component, &ic.position, 20.0) { [INFO] [stdout] 229 | found_cap = true; [INFO] [stdout] 230 | break; [INFO] [stdout] 231 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/analyzer/rules.rs:227:44 [INFO] [stdout] | [INFO] [stdout] 227 | if unit == "nF" && value >= 80.0 && value <= 120.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(80.0..=120.0).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] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/analyzer/rules.rs:391:32 [INFO] [stdout] | [INFO] [stdout] 391 | ... if value_ohm >= 2200.0 && value_ohm <= 10000.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(2200.0..=10000.0).contains(&value_ohm)` [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 `if` statement can be collapsed [INFO] [stdout] --> src/analyzer/rules.rs:456:25 [INFO] [stdout] | [INFO] [stdout] 456 | / if unit == "pF" && value >= 10.0 && value <= 33.0 { [INFO] [stdout] 457 | | if is_nearby(component, &crystal.position, 30.0) { [INFO] [stdout] 458 | | capacitor_count += 1; [INFO] [stdout] 459 | | capacitors_found.push(component.reference.clone()); [INFO] [stdout] 460 | | } [INFO] [stdout] 461 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 456 ~ if unit == "pF" && value >= 10.0 && value <= 33.0 [INFO] [stdout] 457 ~ && is_nearby(component, &crystal.position, 30.0) { [INFO] [stdout] 458 | capacitor_count += 1; [INFO] [stdout] 459 | capacitors_found.push(component.reference.clone()); [INFO] [stdout] 460 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/analyzer/rules.rs:456:44 [INFO] [stdout] | [INFO] [stdout] 456 | if unit == "pF" && value >= 10.0 && value <= 33.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(10.0..=33.0).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 `if` statement can be collapsed [INFO] [stdout] --> src/compliance/power_net_registry.rs:184:21 [INFO] [stdout] | [INFO] [stdout] 184 | / if connection.component_ref == regulator.reference { [INFO] [stdout] 185 | | if output_pins.contains(&connection.pin_number) { [INFO] [stdout] 186 | | // This net is connected to a regulator output [INFO] [stdout] 187 | | self.registry.insert(net.name.clone(), PowerNetEntry { [INFO] [stdout] ... | [INFO] [stdout] 194 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 184 ~ if connection.component_ref == regulator.reference [INFO] [stdout] 185 ~ && output_pins.contains(&connection.pin_number) { [INFO] [stdout] 186 | // This net is connected to a regulator output [INFO] [stdout] ... [INFO] [stdout] 192 | }); [INFO] [stdout] 193 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/compliance/power_net_registry.rs:227:9 [INFO] [stdout] | [INFO] [stdout] 227 | / if ref_upper.starts_with('U') { [INFO] [stdout] 228 | | if value_upper.contains("REG") || value_upper.contains("LDO") { [INFO] [stdout] 229 | | return true; [INFO] [stdout] 230 | | } [INFO] [stdout] 231 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 227 ~ if ref_upper.starts_with('U') [INFO] [stdout] 228 ~ && (value_upper.contains("REG") || value_upper.contains("LDO")) { [INFO] [stdout] 229 | return true; [INFO] [stdout] 230 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/analyzer/rules.rs:896:25 [INFO] [stdout] | [INFO] [stdout] 896 | / if value_u_f >= 10.0 && value_u_f <= 100.0 { [INFO] [stdout] 897 | | if is_nearby(component, ®ulator.position, 30.0) { [INFO] [stdout] 898 | | found_bulk_cap = true; [INFO] [stdout] 899 | | break; [INFO] [stdout] 900 | | } [INFO] [stdout] 901 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 896 ~ if value_u_f >= 10.0 && value_u_f <= 100.0 [INFO] [stdout] 897 ~ && is_nearby(component, ®ulator.position, 30.0) { [INFO] [stdout] 898 | found_bulk_cap = true; [INFO] [stdout] 899 | break; [INFO] [stdout] 900 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/analyzer/rules.rs:896:28 [INFO] [stdout] | [INFO] [stdout] 896 | if value_u_f >= 10.0 && value_u_f <= 100.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(10.0..=100.0).contains(&value_u_f)` [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 `match` can be collapsed into the outer `if let` [INFO] [stdout] --> src/core.rs:140:17 [INFO] [stdout] | [INFO] [stdout] 140 | / match ext { [INFO] [stdout] 141 | | "kicad_sch" | "sch" | "kicad_pcb" | "brd" => files.push(path), [INFO] [stdout] 142 | | _ => {} [INFO] [stdout] 143 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/core.rs:139:25 [INFO] [stdout] | [INFO] [stdout] 139 | if let Some(ext) = path.extension().and_then(|s| s.to_str()) { [INFO] [stdout] | ^^^ replace this binding [INFO] [stdout] 140 | match ext { [INFO] [stdout] 141 | "kicad_sch" | "sch" | "kicad_pcb" | "brd" => files.push(path), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/datasheets/schema.rs:184:1 [INFO] [stdout] | [INFO] [stdout] 184 | / impl Default for CapacitorType { [INFO] [stdout] 185 | | fn default() -> Self { [INFO] [stdout] 186 | | CapacitorType::Any [INFO] [stdout] 187 | | } [INFO] [stdout] 188 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 176 + #[derive(Default)] [INFO] [stdout] 177 | pub enum CapacitorType { [INFO] [stdout] 178 | Ceramic, [INFO] [stdout] ... [INFO] [stdout] 181 | FilmOrCeramic, [INFO] [stdout] 182 ~ #[default] [INFO] [stdout] 183 ~ Any, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/datasheets/schema.rs:199:1 [INFO] [stdout] | [INFO] [stdout] 199 | / impl Default for CapacitorRole { [INFO] [stdout] 200 | | fn default() -> Self { [INFO] [stdout] 201 | | CapacitorRole::Decoupling [INFO] [stdout] 202 | | } [INFO] [stdout] 203 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 192 + #[derive(Default)] [INFO] [stdout] 193 | pub enum CapacitorRole { [INFO] [stdout] 194 | Bypass, // High-frequency filtering (typically 100nF) [INFO] [stdout] 195 | Bulk, // Energy storage (typically 4.7µF-47µF) [INFO] [stdout] 196 ~ #[default] [INFO] [stdout] 197 ~ Decoupling, // General term [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/datasheets/schema.rs:347:1 [INFO] [stdout] | [INFO] [stdout] 347 | / impl Default for DatasheetSeverity { [INFO] [stdout] 348 | | fn default() -> Self { [INFO] [stdout] 349 | | DatasheetSeverity::Warning [INFO] [stdout] 350 | | } [INFO] [stdout] 351 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 341 + #[derive(Default)] [INFO] [stdout] 342 | pub enum DatasheetSeverity { [INFO] [stdout] 343 | Error, // Will definitely cause problems [INFO] [stdout] 344 ~ #[default] [INFO] [stdout] 345 ~ Warning, // Likely to cause problems [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's values [INFO] [stdout] --> src/datasheets/schema.rs:427:28 [INFO] [stdout] | [INFO] [stdout] 427 | for (_key, req) in &self.datasheets { [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] 427 - for (_key, req) in &self.datasheets { [INFO] [stdout] 427 + for req in self.datasheets.values() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's values [INFO] [stdout] --> src/datasheets/schema.rs:438:28 [INFO] [stdout] | [INFO] [stdout] 438 | for (_key, req) in &self.datasheets { [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] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 438 - for (_key, req) in &self.datasheets { [INFO] [stdout] 438 + for req in self.datasheets.values() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/datasheets/matcher.rs:106:34 [INFO] [stdout] | [INFO] [stdout] 106 | if let Some(part_name) = component.lib_id.split(':').last() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 106 - if let Some(part_name) = component.lib_id.split(':').last() { [INFO] [stdout] 106 + if let Some(part_name) = component.lib_id.split(':').next_back() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/datasheets/checker.rs:242:21 [INFO] [stdout] | [INFO] [stdout] 242 | / if component.reference.starts_with('Y') || [INFO] [stdout] 243 | | component.reference.starts_with('X') || [INFO] [stdout] 244 | | component.value.to_lowercase().contains("mhz") || [INFO] [stdout] 245 | | component.value.to_lowercase().contains("crystal") { [INFO] [stdout] 246 | | return true; [INFO] [stdout] 247 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 241 ~ ExternalComponentType::Crystal { .. } [INFO] [stdout] 242 ~ if (component.reference.starts_with('Y') || [INFO] [stdout] 243 | component.reference.starts_with('X') || [INFO] [stdout] 244 | component.value.to_lowercase().contains("mhz") || [INFO] [stdout] 245 ~ component.value.to_lowercase().contains("crystal")) => { [INFO] [stdout] 246 | return true; [INFO] [stdout] 247 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/datasheets/checker.rs:250:21 [INFO] [stdout] | [INFO] [stdout] 250 | / if component.reference.starts_with('R') || component.reference.starts_with('r') { [INFO] [stdout] 251 | | if let Some(value) = parse_resistor_value(&component.value) { [INFO] [stdout] 252 | | // Check if it's a reasonable pull-up/down value (1k-100k) [INFO] [stdout] 253 | | if value >= 1000.0 && value <= 100_000.0 { [INFO] [stdout] ... | [INFO] [stdout] 257 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 249 ~ ExternalComponentType::PullUpResistor | ExternalComponentType::PullDownResistor [INFO] [stdout] 250 ~ if (component.reference.starts_with('R') || component.reference.starts_with('r')) => { [INFO] [stdout] 251 | if let Some(value) = parse_resistor_value(&component.value) { [INFO] [stdout] ... [INFO] [stdout] 256 | } [INFO] [stdout] 257 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/datasheets/checker.rs:260:21 [INFO] [stdout] | [INFO] [stdout] 260 | / if component.reference.starts_with('C') || component.reference.starts_with('c') { [INFO] [stdout] 261 | | return true; [INFO] [stdout] 262 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 259 ~ ExternalComponentType::FilterCapacitor | ExternalComponentType::BypassCapacitor [INFO] [stdout] 260 ~ if (component.reference.starts_with('C') || component.reference.starts_with('c')) => { [INFO] [stdout] 261 | return true; [INFO] [stdout] 262 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/datasheets/checker.rs:265:21 [INFO] [stdout] | [INFO] [stdout] 265 | / if component.reference.starts_with('R') || component.reference.starts_with('r') { [INFO] [stdout] 266 | | if let Some(value) = parse_resistor_value(&component.value) { [INFO] [stdout] 267 | | // Series termination typically 22-33 ohms [INFO] [stdout] 268 | | if value >= 20.0 && value <= 50.0 { [INFO] [stdout] ... | [INFO] [stdout] 272 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 264 ~ ExternalComponentType::SeriesTerminationResistor [INFO] [stdout] 265 ~ if (component.reference.starts_with('R') || component.reference.starts_with('r')) => { [INFO] [stdout] 266 | if let Some(value) = parse_resistor_value(&component.value) { [INFO] [stdout] ... [INFO] [stdout] 271 | } [INFO] [stdout] 272 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/datasheets/checker.rs:275:21 [INFO] [stdout] | [INFO] [stdout] 275 | / if component.reference.starts_with('D') || [INFO] [stdout] 276 | | component.value.to_lowercase().contains("tvs") || [INFO] [stdout] 277 | | component.value.to_lowercase().contains("esd") { [INFO] [stdout] 278 | | return true; [INFO] [stdout] 279 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 274 ~ ExternalComponentType::ProtectionDiode [INFO] [stdout] 275 ~ if (component.reference.starts_with('D') || [INFO] [stdout] 276 | component.value.to_lowercase().contains("tvs") || [INFO] [stdout] 277 ~ component.value.to_lowercase().contains("esd")) => { [INFO] [stdout] 278 | return true; [INFO] [stdout] 279 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/datasheets/checker.rs:253:32 [INFO] [stdout] | [INFO] [stdout] 253 | ... if value >= 1000.0 && value <= 100_000.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(1000.0..=100_000.0).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: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/datasheets/checker.rs:268:32 [INFO] [stdout] | [INFO] [stdout] 268 | ... if value >= 20.0 && value <= 50.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(20.0..=50.0).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: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/datasheets/checker.rs:473:28 [INFO] [stdout] | [INFO] [stdout] 473 | if value >= 1000.0 && value <= 100_000.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(1000.0..=100_000.0).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: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/datasheets/checker.rs:623:16 [INFO] [stdout] | [INFO] [stdout] 623 | if num >= 1.0 && num <= 1000.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(1.0..=1000.0).contains(&num)` [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: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/parser/kicad.rs:373:18 [INFO] [stdout] | [INFO] [stdout] 373 | .or_insert_with(HashSet::new); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/analyzer/drs.rs:389:26 [INFO] [stdout] | [INFO] [stdout] 389 | let risk_index = (proximity_penalty + inductance_penalty + mismatch_penalty) [INFO] [stdout] | __________________________^ [INFO] [stdout] 390 | | .min(100.0) [INFO] [stdout] 391 | | .max(0.0); [INFO] [stdout] | |_____________________^ help: replace with clamp: `(proximity_penalty + inductance_penalty + mismatch_penalty).clamp(0.0, 100.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] = note: `#[warn(clippy::manual_clamp)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/parser/pcb.rs:217:9 [INFO] [stdout] | [INFO] [stdout] 217 | / setup.copper_thickness = CopperThickness { [INFO] [stdout] 218 | | outer: 1.0, [INFO] [stdout] 219 | | inner: 0.5, [INFO] [stdout] 220 | | }; [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `parser::pcb_schema::PcbSetup { copper_thickness: CopperThickness { [INFO] [stdout] outer: 1.0, [INFO] [stdout] inner: 0.5, [INFO] [stdout] }, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/parser/pcb.rs:214:9 [INFO] [stdout] | [INFO] [stdout] 214 | let mut setup = PcbSetup::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/parser/pcb.rs:607:23 [INFO] [stdout] | [INFO] [stdout] 607 | let keepout = if let Some(ko_exp) = sexp.get("keepout") { [INFO] [stdout] | _______________________^ [INFO] [stdout] 608 | | Some(ZoneKeepout { [INFO] [stdout] 609 | | tracks: Self::get_string_value(ko_exp, "tracks") == Some("not_allowed".to_string()), [INFO] [stdout] 610 | | vias: Self::get_string_value(ko_exp, "vias") == Some("not_allowed".to_string()), [INFO] [stdout] ... | [INFO] [stdout] 616 | | None [INFO] [stdout] 617 | | }; [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 607 ~ let keepout = sexp.get("keepout").map(|ko_exp| ZoneKeepout { [INFO] [stdout] 608 + tracks: Self::get_string_value(ko_exp, "tracks") == Some("not_allowed".to_string()), [INFO] [stdout] 609 + vias: Self::get_string_value(ko_exp, "vias") == Some("not_allowed".to_string()), [INFO] [stdout] 610 + pads: Self::get_string_value(ko_exp, "pads") == Some("not_allowed".to_string()), [INFO] [stdout] 611 + copperpour: Self::get_string_value(ko_exp, "copperpour") == Some("not_allowed".to_string()), [INFO] [stdout] 612 + footprints: Self::get_string_value(ko_exp, "footprints") == Some("not_allowed".to_string()), [INFO] [stdout] 613 ~ }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/analyzer/drs.rs:712:17 [INFO] [stdout] | [INFO] [stdout] 712 | / if ref_name.starts_with('C') || ref_name.starts_with('c') { [INFO] [stdout] 713 | | if other_footprint.uuid != footprint.uuid { [INFO] [stdout] 714 | | for pad in &other_footprint.pads { [INFO] [stdout] 715 | | if pad.net == Some(via.net) { [INFO] [stdout] ... | [INFO] [stdout] 723 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 712 ~ if (ref_name.starts_with('C') || ref_name.starts_with('c')) { [INFO] [stdout] 713 ~ && other_footprint.uuid != footprint.uuid { [INFO] [stdout] 714 | for pad in &other_footprint.pads { [INFO] [stdout] ... [INFO] [stdout] 721 | } [INFO] [stdout] 722 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/analyzer/drs.rs:1001:23 [INFO] [stdout] | [INFO] [stdout] 1001 | let cap_pad = cap_footprint.pads.iter() [INFO] [stdout] | _______________________^ [INFO] [stdout] 1002 | | .find(|p| p.net == Some(net_id) || p.net_name.as_ref().map(|n| n == net_name).unwrap_or(false)) [INFO] [stdout] 1003 | | .ok_or_else(|| PathError::InvalidNetConnection)?; [INFO] [stdout] | |___________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `ok_or` instead [INFO] [stdout] | [INFO] [stdout] 1003 - .ok_or_else(|| PathError::InvalidNetConnection)?; [INFO] [stdout] 1003 + .ok_or(PathError::InvalidNetConnection)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/analyzer/drs.rs:1006:22 [INFO] [stdout] | [INFO] [stdout] 1006 | let ic_pad = ic_footprint.pads.iter() [INFO] [stdout] | ______________________^ [INFO] [stdout] 1007 | | .find(|p| p.net == Some(net_id) || p.net_name.as_ref().map(|n| n == net_name).unwrap_or(false)) [INFO] [stdout] 1008 | | .ok_or_else(|| PathError::InvalidNetConnection)?; [INFO] [stdout] | |___________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `ok_or` instead [INFO] [stdout] | [INFO] [stdout] 1008 - .ok_or_else(|| PathError::InvalidNetConnection)?; [INFO] [stdout] 1008 + .ok_or(PathError::InvalidNetConnection)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/analyzer/drs.rs:1122:49 [INFO] [stdout] | [INFO] [stdout] 1122 | graph.entry(start_node.clone()).or_insert_with(Vec::new).push(end_node.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/analyzer/drs.rs:1123:39 [INFO] [stdout] | [INFO] [stdout] 1123 | graph.entry(end_node).or_insert_with(Vec::new).push(start_node); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/analyzer/drs.rs:1149:59 [INFO] [stdout] | [INFO] [stdout] 1149 | ... graph.entry(via_node.clone()).or_insert_with(Vec::new).push(trace_node.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/parser/pcb_schema.rs:56:1 [INFO] [stdout] | [INFO] [stdout] 56 | / impl Default for LayerType { [INFO] [stdout] 57 | | fn default() -> Self { [INFO] [stdout] 58 | | LayerType::Signal [INFO] [stdout] 59 | | } [INFO] [stdout] 60 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 47 + #[derive(Default)] [INFO] [stdout] 48 | pub enum LayerType { [INFO] [stdout] 49 ~ #[default] [INFO] [stdout] 50 ~ Signal, // Copper signal layer [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/analyzer/drs.rs:1150:53 [INFO] [stdout] | [INFO] [stdout] 1150 | ... graph.entry(trace_node).or_insert_with(Vec::new).push(via_node); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/analyzer/drs.rs:1164:59 [INFO] [stdout] | [INFO] [stdout] 1164 | ... graph.entry(via_node.clone()).or_insert_with(Vec::new).push(trace_node.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/analyzer/drs.rs:1165:53 [INFO] [stdout] | [INFO] [stdout] 1165 | ... graph.entry(trace_node).or_insert_with(Vec::new).push(via_node); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/analyzer/drs.rs:1190:60 [INFO] [stdout] | [INFO] [stdout] 1190 | ... graph.entry(zone_node.clone()).or_insert_with(Vec::new).push(trace_node.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/analyzer/drs.rs:1191:53 [INFO] [stdout] | [INFO] [stdout] 1191 | ... graph.entry(trace_node).or_insert_with(Vec::new).push(zone_node); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/analyzer/drs.rs:1204:60 [INFO] [stdout] | [INFO] [stdout] 1204 | ... graph.entry(zone_node.clone()).or_insert_with(Vec::new).push(trace_node.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/analyzer/drs.rs:1205:53 [INFO] [stdout] | [INFO] [stdout] 1205 | ... graph.entry(trace_node).or_insert_with(Vec::new).push(zone_node); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/analyzer/drs.rs:1500:9 [INFO] [stdout] | [INFO] [stdout] 1500 | pcb.uuid = "test-pcb".to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `parser::pcb_schema::PcbDesign { uuid: "test-pcb".to_string(), filename: "test.kicad_pcb".to_string(), ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/analyzer/drs.rs:1499:9 [INFO] [stdout] | [INFO] [stdout] 1499 | let mut pcb = PcbDesign::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `result` after checking its variant with `is_ok` [INFO] [stdout] --> src/analyzer/drs.rs:1826:24 [INFO] [stdout] | [INFO] [stdout] 1825 | if result.is_ok() { [INFO] [stdout] | ----------------- help: try: `if let Ok() = result` [INFO] [stdout] 1826 | let path = result.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap_err` on `result` after checking its variant with `is_ok` [INFO] [stdout] --> src/analyzer/drs.rs:1842:91 [INFO] [stdout] | [INFO] [stdout] 1825 | if result.is_ok() { [INFO] [stdout] | ----------------- help: try: `if let Err() = result` [INFO] [stdout] ... [INFO] [stdout] 1842 | println!("Path finding failed (zone connectivity may need refinement): {:?}", result.unwrap_err()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/analyzer/capacitor_classifier.rs:136:12 [INFO] [stdout] | [INFO] [stdout] 136 | if value_pf < 1.0 || value_pf > 47.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!(1.0..=47.0).contains(&value_pf)` [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/analyzer/capacitor_classifier.rs:168:69 [INFO] [stdout] | [INFO] [stdout] 168 | if (has_xtal_net && has_gnd) || (near_crystal && has_gnd && value_pf >= 10.0 && value_pf <= 33.0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(10.0..=33.0).contains(&value_pf)` [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/analyzer/capacitor_classifier.rs:214:12 [INFO] [stdout] | [INFO] [stdout] 214 | if (has_switch_node && has_gnd) || (near_switch && has_gnd) { [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] 214 - if (has_switch_node && has_gnd) || (near_switch && has_gnd) { [INFO] [stdout] 214 + if !(!has_gnd || !has_switch_node && !near_switch) { [INFO] [stdout] | [INFO] [stdout] 214 - if (has_switch_node && has_gnd) || (near_switch && has_gnd) { [INFO] [stdout] 214 + if (near_switch || has_switch_node) && has_gnd { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/analyzer/capacitor_classifier.rs:221:28 [INFO] [stdout] | [INFO] [stdout] 221 | reasoning: format!("Snubber: connected to switch node or near MOSFET/inductor"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Snubber: connected to switch node or near MOSFET/inductor".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: module has the same name as its containing module [INFO] [stdout] --> src/analyzer/capacitor_classifier_tests.rs:10:1 [INFO] [stdout] | [INFO] [stdout] 10 | / mod comprehensive_tests { [INFO] [stdout] 11 | | use crate::analyzer::capacitor_classifier::{CapacitorClassifier, CapacitorFunction}; [INFO] [stdout] 12 | | use crate::parser::schema::{Component, Schematic, Position, Pin, Net, Connection}; [INFO] [stdout] 13 | | use crate::compliance::power_net_registry::PowerNetRegistry; [INFO] [stdout] ... | [INFO] [stdout] 561 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] = note: `#[warn(clippy::module_inception)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/parser/pcb_schema.rs:221:1 [INFO] [stdout] | [INFO] [stdout] 221 | / impl Default for ViaType { [INFO] [stdout] 222 | | fn default() -> Self { [INFO] [stdout] 223 | | ViaType::Through [INFO] [stdout] 224 | | } [INFO] [stdout] 225 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 214 + #[derive(Default)] [INFO] [stdout] 215 | pub enum ViaType { [INFO] [stdout] 216 ~ #[default] [INFO] [stdout] 217 ~ Through, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/parser/pcb_schema.rs:250:1 [INFO] [stdout] | [INFO] [stdout] 250 | / impl Default for ZoneConnectType { [INFO] [stdout] 251 | | fn default() -> Self { [INFO] [stdout] 252 | | ZoneConnectType::ThermalRelief [INFO] [stdout] 253 | | } [INFO] [stdout] 254 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 244 + #[derive(Default)] [INFO] [stdout] 245 | pub enum ZoneConnectType { [INFO] [stdout] 246 | Solid, [INFO] [stdout] 247 ~ #[default] [INFO] [stdout] 248 ~ ThermalRelief, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/parser/pcb_schema.rs:333:1 [INFO] [stdout] | [INFO] [stdout] 333 | / impl Default for PcbDesign { [INFO] [stdout] 334 | | fn default() -> Self { [INFO] [stdout] 335 | | Self { [INFO] [stdout] 336 | | uuid: String::new(), [INFO] [stdout] ... | [INFO] [stdout] 350 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 11 + #[derive(Default)] [INFO] [stdout] 12 | pub struct PcbDesign { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/parser/netlist.rs:243:47 [INFO] [stdout] | [INFO] [stdout] 243 | pin_to_net.entry(key).or_insert_with(Vec::new).push(PinNetConnection { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/parser/netlist.rs:324:12 [INFO] [stdout] | [INFO] [stdout] 324 | if t < 0.0 || t > 1.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: use: `!(0.0..=1.0).contains(&t)` [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: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/parser/kicad_legacy.rs:284:9 [INFO] [stdout] | [INFO] [stdout] 284 | general.thickness = 1.6; // sensible default [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `parser::pcb_schema::PcbGeneral { thickness: 1.6, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/parser/kicad_legacy.rs:283:9 [INFO] [stdout] | [INFO] [stdout] 283 | let mut general = PcbGeneral::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/parser/kicad_legacy.rs:337:29 [INFO] [stdout] | [INFO] [stdout] 337 | / ... if setup.track_width == 0.0 { [INFO] [stdout] 338 | | ... setup.track_width = pcb_coord(val, unit_factor); [INFO] [stdout] 339 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 336 ~ "TrackWidth" [INFO] [stdout] 337 ~ if setup.track_width == 0.0 => { [INFO] [stdout] 338 | setup.track_width = pcb_coord(val, unit_factor); [INFO] [stdout] 339 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:378:28 [INFO] [stdout] | [INFO] [stdout] 378 | let rest = &line[3..]; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:376:13 [INFO] [stdout] | [INFO] [stdout] 376 | if line.starts_with("Na ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] = note: `#[warn(clippy::manual_strip)]` on by default [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 376 ~ if let Some(rest) = line.strip_prefix("Na ") { [INFO] [stdout] 377 | // Format: Na "" [INFO] [stdout] 378 ~ let parts: Vec<&str> = rest.splitn(2, ' ').collect(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:423:40 [INFO] [stdout] | [INFO] [stdout] 423 | let parts: Vec<&str> = line[3..].split_whitespace().collect(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:421:13 [INFO] [stdout] | [INFO] [stdout] 421 | if line.starts_with("Po ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 421 ~ if let Some() = line.strip_prefix("Po ") { [INFO] [stdout] 422 | // Po x y orient layer timestamp attr [INFO] [stdout] 423 ~ let parts: Vec<&str> = .split_whitespace().collect(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:437:36 [INFO] [stdout] | [INFO] [stdout] 437 | fp.footprint_lib = line[3..].trim().to_string(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:436:20 [INFO] [stdout] | [INFO] [stdout] 436 | } else if line.starts_with("Li ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 436 ~ } else if let Some() = line.strip_prefix("Li ") { [INFO] [stdout] 437 ~ fp.footprint_lib = .trim().to_string(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:448:56 [INFO] [stdout] | [INFO] [stdout] 448 | .insert("Description".to_string(), line[3..].trim().to_string()); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:446:20 [INFO] [stdout] | [INFO] [stdout] 446 | } else if line.starts_with("Cd ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 446 ~ } else if let Some() = line.strip_prefix("Cd ") { [INFO] [stdout] 447 | fp.properties [INFO] [stdout] 448 ~ .insert("Description".to_string(), .trim().to_string()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:451:53 [INFO] [stdout] | [INFO] [stdout] 451 | .insert("Keywords".to_string(), line[3..].trim().to_string()); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:449:20 [INFO] [stdout] | [INFO] [stdout] 449 | } else if line.starts_with("Kw ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 449 ~ } else if let Some() = line.strip_prefix("Kw ") { [INFO] [stdout] 450 | fp.properties [INFO] [stdout] 451 ~ .insert("Keywords".to_string(), .trim().to_string()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:497:28 [INFO] [stdout] | [INFO] [stdout] 497 | let rest = &line[3..]; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:495:13 [INFO] [stdout] | [INFO] [stdout] 495 | if line.starts_with("Sh ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 495 ~ if let Some(rest) = line.strip_prefix("Sh ") { [INFO] [stdout] 496 | // Sh "number" shape width height dx dy orient [INFO] [stdout] 497 ~ if let Some(start) = rest.find('"') { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:520:40 [INFO] [stdout] | [INFO] [stdout] 520 | let parts: Vec<&str> = line[3..].split_whitespace().collect(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:518:20 [INFO] [stdout] | [INFO] [stdout] 518 | } else if line.starts_with("Dr ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 518 ~ } else if let Some() = line.strip_prefix("Dr ") { [INFO] [stdout] 519 | // Dr diameter offset_x offset_y [INFO] [stdout] 520 ~ let parts: Vec<&str> = .split_whitespace().collect(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:546:40 [INFO] [stdout] | [INFO] [stdout] 546 | let parts: Vec<&str> = line[3..].split_whitespace().collect(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:544:20 [INFO] [stdout] | [INFO] [stdout] 544 | } else if line.starts_with("At ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 544 ~ } else if let Some() = line.strip_prefix("At ") { [INFO] [stdout] 545 | // At type N layer_mask [INFO] [stdout] 546 ~ let parts: Vec<&str> = .split_whitespace().collect(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:552:28 [INFO] [stdout] | [INFO] [stdout] 552 | let rest = &line[3..]; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:550:20 [INFO] [stdout] | [INFO] [stdout] 550 | } else if line.starts_with("Ne ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 550 ~ } else if let Some(rest) = line.strip_prefix("Ne ") { [INFO] [stdout] 551 | // Ne net_number "net_name" [INFO] [stdout] 552 ~ let parts: Vec<&str> = rest.splitn(2, ' ').collect(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:562:40 [INFO] [stdout] | [INFO] [stdout] 562 | let parts: Vec<&str> = line[3..].split_whitespace().collect(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:560:20 [INFO] [stdout] | [INFO] [stdout] 560 | } else if line.starts_with("Po ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 560 ~ } else if let Some() = line.strip_prefix("Po ") { [INFO] [stdout] 561 | // Po x y (pad position relative to module) [INFO] [stdout] 562 ~ let parts: Vec<&str> = .split_whitespace().collect(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:572:47 [INFO] [stdout] | [INFO] [stdout] 572 | pad.layers = parse_layer_mask(line[3..].trim()); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:571:20 [INFO] [stdout] | [INFO] [stdout] 571 | } else if line.starts_with("La ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 571 ~ } else if let Some() = line.strip_prefix("La ") { [INFO] [stdout] 572 ~ pad.layers = parse_layer_mask(.trim()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:614:43 [INFO] [stdout] | [INFO] [stdout] 614 | let po_parts: Vec<&str> = line[3..].split_whitespace().collect(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:613:13 [INFO] [stdout] | [INFO] [stdout] 613 | if line.starts_with("Po ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 613 ~ if let Some() = line.strip_prefix("Po ") { [INFO] [stdout] 614 ~ let po_parts: Vec<&str> = .split_whitespace().collect(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:620:51 [INFO] [stdout] | [INFO] [stdout] 620 | let de_parts: Vec<&str> = de_line[3..].split_whitespace().collect(); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:619:21 [INFO] [stdout] | [INFO] [stdout] 619 | if de_line.starts_with("De ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 619 ~ if let Some() = de_line.strip_prefix("De ") { [INFO] [stdout] 620 ~ let de_parts: Vec<&str> = .split_whitespace().collect(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:728:33 [INFO] [stdout] | [INFO] [stdout] 728 | let layer_num = line[7..].trim().parse::().unwrap_or(0); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:727:20 [INFO] [stdout] | [INFO] [stdout] 727 | } else if line.starts_with("ZLayer ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 727 ~ } else if let Some() = line.strip_prefix("ZLayer ") { [INFO] [stdout] 728 ~ let layer_num = .trim().parse::().unwrap_or(0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:731:27 [INFO] [stdout] | [INFO] [stdout] 731 | let val = line[14..].trim().parse::().unwrap_or(0.0); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:730:20 [INFO] [stdout] | [INFO] [stdout] 730 | } else if line.starts_with("ZMinThickness ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 730 ~ } else if let Some() = line.strip_prefix("ZMinThickness ") { [INFO] [stdout] 731 ~ let val = .trim().parse::().unwrap_or(0.0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:734:33 [INFO] [stdout] | [INFO] [stdout] 734 | zone.priority = line[10..].trim().parse::().unwrap_or(0); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:733:20 [INFO] [stdout] | [INFO] [stdout] 733 | } else if line.starts_with("ZPriority ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 733 ~ } else if let Some() = line.strip_prefix("ZPriority ") { [INFO] [stdout] 734 ~ zone.priority = .trim().parse::().unwrap_or(0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:736:43 [INFO] [stdout] | [INFO] [stdout] 736 | zone.connect_pads = match line[17..].trim() { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:735:20 [INFO] [stdout] | [INFO] [stdout] 735 | } else if line.starts_with("ZConnectPadsType ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 735 ~ } else if let Some() = line.strip_prefix("ZConnectPadsType ") { [INFO] [stdout] 736 ~ zone.connect_pads = match .trim() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:742:40 [INFO] [stdout] | [INFO] [stdout] 742 | let parts: Vec<&str> = line[8..].split_whitespace().collect(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:741:20 [INFO] [stdout] | [INFO] [stdout] 741 | } else if line.starts_with("ZCorner ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 741 ~ } else if let Some() = line.strip_prefix("ZCorner ") { [INFO] [stdout] 742 ~ let parts: Vec<&str> = .split_whitespace().collect(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:813:40 [INFO] [stdout] | [INFO] [stdout] 813 | let parts: Vec<&str> = line[3..].split_whitespace().collect(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:811:13 [INFO] [stdout] | [INFO] [stdout] 811 | if line.starts_with("Po ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 811 ~ if let Some() = line.strip_prefix("Po ") { [INFO] [stdout] 812 | // Po shape x1 y1 x2 y2 width [INFO] [stdout] 813 ~ let parts: Vec<&str> = .split_whitespace().collect(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:840:40 [INFO] [stdout] | [INFO] [stdout] 840 | let parts: Vec<&str> = line[3..].split_whitespace().collect(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:839:20 [INFO] [stdout] | [INFO] [stdout] 839 | } else if line.starts_with("De ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 839 ~ } else if let Some() = line.strip_prefix("De ") { [INFO] [stdout] 840 ~ let parts: Vec<&str> = .split_whitespace().collect(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:895:40 [INFO] [stdout] | [INFO] [stdout] 895 | let parts: Vec<&str> = line[2..].split_whitespace().collect(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:893:13 [INFO] [stdout] | [INFO] [stdout] 893 | if line.starts_with("L ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 893 ~ if let Some() = line.strip_prefix("L ") { [INFO] [stdout] 894 | // L Library:Component Reference [INFO] [stdout] 895 ~ let parts: Vec<&str> = .split_whitespace().collect(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:910:40 [INFO] [stdout] | [INFO] [stdout] 910 | let parts: Vec<&str> = line[2..].split_whitespace().collect(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:908:20 [INFO] [stdout] | [INFO] [stdout] 908 | } else if line.starts_with("U ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 908 ~ } else if let Some() = line.strip_prefix("U ") { [INFO] [stdout] 909 | // U unit convert timestamp [INFO] [stdout] 910 ~ let parts: Vec<&str> = .split_whitespace().collect(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:919:40 [INFO] [stdout] | [INFO] [stdout] 919 | let parts: Vec<&str> = line[2..].split_whitespace().collect(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:917:20 [INFO] [stdout] | [INFO] [stdout] 917 | } else if line.starts_with("P ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 917 ~ } else if let Some() = line.strip_prefix("P ") { [INFO] [stdout] 918 | // P X Y [INFO] [stdout] 919 ~ let parts: Vec<&str> = .split_whitespace().collect(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:928:28 [INFO] [stdout] | [INFO] [stdout] 928 | let rest = &line[2..]; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:925:20 [INFO] [stdout] | [INFO] [stdout] 925 | } else if line.starts_with("F ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 925 ~ } else if let Some(rest) = line.strip_prefix("F ") { [INFO] [stdout] 926 | // F field_num "text" orientation X Y size flags hjust vjust style "fieldname" [INFO] [stdout] 927 | // Parse more carefully - text may contain spaces [INFO] [stdout] 928 ~ let mut parts = rest.split_whitespace(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: found call to `str::trim` before `str::split_whitespace` [INFO] [stdout] --> src/parser/kicad_legacy.rs:964:45 [INFO] [stdout] | [INFO] [stdout] 964 | let parts: Vec<&str> = line.trim().split_whitespace().collect(); [INFO] [stdout] | ^^^^^^^ help: remove `trim()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trim_split_whitespace [INFO] [stdout] = note: `#[warn(clippy::trim_split_whitespace)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/parser/kicad_legacy.rs:965:20 [INFO] [stdout] | [INFO] [stdout] 965 | if parts.len() >= 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!parts.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: length comparison to zero [INFO] [stdout] --> src/parser/kicad_legacy.rs:1035:19 [INFO] [stdout] | [INFO] [stdout] 1035 | } else if text.len() > 0 && text.chars().next().unwrap().is_uppercase() { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!text.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] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/parser/kicad_legacy.rs:1065:37 [INFO] [stdout] | [INFO] [stdout] 1065 | net_map.entry(net_name).or_insert_with(HashSet::new); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/parser/format_detector.rs:128:18 [INFO] [stdout] | [INFO] [stdout] 128 | .map_err(|e| KicadParseError::Io(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `KicadParseError::Io` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/parser/format_detector.rs:155:18 [INFO] [stdout] | [INFO] [stdout] 155 | .map_err(|e| PcbParseError::Io(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `PcbParseError::Io` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/ucs/schema.rs:28:1 [INFO] [stdout] | [INFO] [stdout] 28 | / impl Default for SourceCAD { [INFO] [stdout] 29 | | fn default() -> Self { [INFO] [stdout] 30 | | SourceCAD::Unknown [INFO] [stdout] 31 | | } [INFO] [stdout] 32 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 18 + #[derive(Default)] [INFO] [stdout] 19 | pub enum SourceCAD { [INFO] [stdout] 20 | KiCad, [INFO] [stdout] ... [INFO] [stdout] 25 | EDIF, [INFO] [stdout] 26 ~ #[default] [INFO] [stdout] 27 ~ Unknown, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/ucs/schema.rs:116:1 [INFO] [stdout] | [INFO] [stdout] 116 | / impl Default for ElectricalType { [INFO] [stdout] 117 | | fn default() -> Self { [INFO] [stdout] 118 | | ElectricalType::Unspecified [INFO] [stdout] 119 | | } [INFO] [stdout] 120 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 102 + #[derive(Default)] [INFO] [stdout] 103 | pub enum ElectricalType { [INFO] [stdout] 104 | Input, [INFO] [stdout] ... [INFO] [stdout] 113 | NoConnect, [INFO] [stdout] 114 ~ #[default] [INFO] [stdout] 115 ~ Unspecified, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/ucs/schema.rs:445:1 [INFO] [stdout] | [INFO] [stdout] 445 | / impl Default for SignalType { [INFO] [stdout] 446 | | fn default() -> Self { [INFO] [stdout] 447 | | SignalType::Unknown [INFO] [stdout] 448 | | } [INFO] [stdout] 449 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 432 + #[derive(Default)] [INFO] [stdout] 433 | pub enum SignalType { [INFO] [stdout] 434 | Analog, [INFO] [stdout] ... [INFO] [stdout] 442 | Control, [INFO] [stdout] 443 ~ #[default] [INFO] [stdout] 444 ~ Unknown, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/compliance/net_classifier.rs:95:1 [INFO] [stdout] | [INFO] [stdout] 95 | / impl Default for NetClassifier { [INFO] [stdout] 96 | | fn default() -> Self { [INFO] [stdout] 97 | | Self { [INFO] [stdout] 98 | | custom_high_speed: Vec::new(), [INFO] [stdout] ... | [INFO] [stdout] 105 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 82 + #[derive(Default)] [INFO] [stdout] 83 | pub struct NetClassifier { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this manual char comparison can be written more succinctly [INFO] [stdout] --> src/ucs/circuit.rs:397:45 [INFO] [stdout] | [INFO] [stdout] 397 | .trim_start_matches(|c: char| c == '-' || c == '_') [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an array of `char`: `['-', '_']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison [INFO] [stdout] = note: `#[warn(clippy::manual_pattern_char_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/compliance/power_net_registry.rs:184:21 [INFO] [stdout] | [INFO] [stdout] 184 | / if connection.component_ref == regulator.reference { [INFO] [stdout] 185 | | if output_pins.contains(&connection.pin_number) { [INFO] [stdout] 186 | | // This net is connected to a regulator output [INFO] [stdout] 187 | | self.registry.insert(net.name.clone(), PowerNetEntry { [INFO] [stdout] ... | [INFO] [stdout] 194 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 184 ~ if connection.component_ref == regulator.reference [INFO] [stdout] 185 ~ && output_pins.contains(&connection.pin_number) { [INFO] [stdout] 186 | // This net is connected to a regulator output [INFO] [stdout] ... [INFO] [stdout] 192 | }); [INFO] [stdout] 193 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/compliance/power_net_registry.rs:227:9 [INFO] [stdout] | [INFO] [stdout] 227 | / if ref_upper.starts_with('U') { [INFO] [stdout] 228 | | if value_upper.contains("REG") || value_upper.contains("LDO") { [INFO] [stdout] 229 | | return true; [INFO] [stdout] 230 | | } [INFO] [stdout] 231 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 227 ~ if ref_upper.starts_with('U') [INFO] [stdout] 228 ~ && (value_upper.contains("REG") || value_upper.contains("LDO")) { [INFO] [stdout] 229 | return true; [INFO] [stdout] 230 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `if let` [INFO] [stdout] --> src/core.rs:140:17 [INFO] [stdout] | [INFO] [stdout] 140 | / match ext { [INFO] [stdout] 141 | | "kicad_sch" | "sch" | "kicad_pcb" | "brd" => files.push(path), [INFO] [stdout] 142 | | _ => {} [INFO] [stdout] 143 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/core.rs:139:25 [INFO] [stdout] | [INFO] [stdout] 139 | if let Some(ext) = path.extension().and_then(|s| s.to_str()) { [INFO] [stdout] | ^^^ replace this binding [INFO] [stdout] 140 | match ext { [INFO] [stdout] 141 | "kicad_sch" | "sch" | "kicad_pcb" | "brd" => files.push(path), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ucs/analysis.rs:419:25 [INFO] [stdout] | [INFO] [stdout] 419 | fn find_other_side_nets<'a>( [INFO] [stdout] | ^^ [INFO] [stdout] 420 | circuit: &'a Circuit, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 419 ~ fn find_other_side_nets( [INFO] [stdout] 420 ~ circuit: &Circuit, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/datasheets/schema.rs:184:1 [INFO] [stdout] | [INFO] [stdout] 184 | / impl Default for CapacitorType { [INFO] [stdout] 185 | | fn default() -> Self { [INFO] [stdout] 186 | | CapacitorType::Any [INFO] [stdout] 187 | | } [INFO] [stdout] 188 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 176 + #[derive(Default)] [INFO] [stdout] 177 | pub enum CapacitorType { [INFO] [stdout] 178 | Ceramic, [INFO] [stdout] ... [INFO] [stdout] 181 | FilmOrCeramic, [INFO] [stdout] 182 ~ #[default] [INFO] [stdout] 183 ~ Any, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/datasheets/schema.rs:199:1 [INFO] [stdout] | [INFO] [stdout] 199 | / impl Default for CapacitorRole { [INFO] [stdout] 200 | | fn default() -> Self { [INFO] [stdout] 201 | | CapacitorRole::Decoupling [INFO] [stdout] 202 | | } [INFO] [stdout] 203 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 192 + #[derive(Default)] [INFO] [stdout] 193 | pub enum CapacitorRole { [INFO] [stdout] 194 | Bypass, // High-frequency filtering (typically 100nF) [INFO] [stdout] 195 | Bulk, // Energy storage (typically 4.7µF-47µF) [INFO] [stdout] 196 ~ #[default] [INFO] [stdout] 197 ~ Decoupling, // General term [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/datasheets/schema.rs:347:1 [INFO] [stdout] | [INFO] [stdout] 347 | / impl Default for DatasheetSeverity { [INFO] [stdout] 348 | | fn default() -> Self { [INFO] [stdout] 349 | | DatasheetSeverity::Warning [INFO] [stdout] 350 | | } [INFO] [stdout] 351 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 341 + #[derive(Default)] [INFO] [stdout] 342 | pub enum DatasheetSeverity { [INFO] [stdout] 343 | Error, // Will definitely cause problems [INFO] [stdout] 344 ~ #[default] [INFO] [stdout] 345 ~ Warning, // Likely to cause problems [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's values [INFO] [stdout] --> src/datasheets/schema.rs:427:28 [INFO] [stdout] | [INFO] [stdout] 427 | for (_key, req) in &self.datasheets { [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] 427 - for (_key, req) in &self.datasheets { [INFO] [stdout] 427 + for req in self.datasheets.values() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's values [INFO] [stdout] --> src/datasheets/schema.rs:438:28 [INFO] [stdout] | [INFO] [stdout] 438 | for (_key, req) in &self.datasheets { [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] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 438 - for (_key, req) in &self.datasheets { [INFO] [stdout] 438 + for req in self.datasheets.values() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/datasheets/matcher.rs:106:34 [INFO] [stdout] | [INFO] [stdout] 106 | if let Some(part_name) = component.lib_id.split(':').last() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 106 - if let Some(part_name) = component.lib_id.split(':').last() { [INFO] [stdout] 106 + if let Some(part_name) = component.lib_id.split(':').next_back() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/datasheets/checker.rs:242:21 [INFO] [stdout] | [INFO] [stdout] 242 | / if component.reference.starts_with('Y') || [INFO] [stdout] 243 | | component.reference.starts_with('X') || [INFO] [stdout] 244 | | component.value.to_lowercase().contains("mhz") || [INFO] [stdout] 245 | | component.value.to_lowercase().contains("crystal") { [INFO] [stdout] 246 | | return true; [INFO] [stdout] 247 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 241 ~ ExternalComponentType::Crystal { .. } [INFO] [stdout] 242 ~ if (component.reference.starts_with('Y') || [INFO] [stdout] 243 | component.reference.starts_with('X') || [INFO] [stdout] 244 | component.value.to_lowercase().contains("mhz") || [INFO] [stdout] 245 ~ component.value.to_lowercase().contains("crystal")) => { [INFO] [stdout] 246 | return true; [INFO] [stdout] 247 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/datasheets/checker.rs:250:21 [INFO] [stdout] | [INFO] [stdout] 250 | / if component.reference.starts_with('R') || component.reference.starts_with('r') { [INFO] [stdout] 251 | | if let Some(value) = parse_resistor_value(&component.value) { [INFO] [stdout] 252 | | // Check if it's a reasonable pull-up/down value (1k-100k) [INFO] [stdout] 253 | | if value >= 1000.0 && value <= 100_000.0 { [INFO] [stdout] ... | [INFO] [stdout] 257 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 249 ~ ExternalComponentType::PullUpResistor | ExternalComponentType::PullDownResistor [INFO] [stdout] 250 ~ if (component.reference.starts_with('R') || component.reference.starts_with('r')) => { [INFO] [stdout] 251 | if let Some(value) = parse_resistor_value(&component.value) { [INFO] [stdout] ... [INFO] [stdout] 256 | } [INFO] [stdout] 257 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/datasheets/checker.rs:260:21 [INFO] [stdout] | [INFO] [stdout] 260 | / if component.reference.starts_with('C') || component.reference.starts_with('c') { [INFO] [stdout] 261 | | return true; [INFO] [stdout] 262 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 259 ~ ExternalComponentType::FilterCapacitor | ExternalComponentType::BypassCapacitor [INFO] [stdout] 260 ~ if (component.reference.starts_with('C') || component.reference.starts_with('c')) => { [INFO] [stdout] 261 | return true; [INFO] [stdout] 262 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/datasheets/checker.rs:265:21 [INFO] [stdout] | [INFO] [stdout] 265 | / if component.reference.starts_with('R') || component.reference.starts_with('r') { [INFO] [stdout] 266 | | if let Some(value) = parse_resistor_value(&component.value) { [INFO] [stdout] 267 | | // Series termination typically 22-33 ohms [INFO] [stdout] 268 | | if value >= 20.0 && value <= 50.0 { [INFO] [stdout] ... | [INFO] [stdout] 272 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 264 ~ ExternalComponentType::SeriesTerminationResistor [INFO] [stdout] 265 ~ if (component.reference.starts_with('R') || component.reference.starts_with('r')) => { [INFO] [stdout] 266 | if let Some(value) = parse_resistor_value(&component.value) { [INFO] [stdout] ... [INFO] [stdout] 271 | } [INFO] [stdout] 272 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/datasheets/checker.rs:275:21 [INFO] [stdout] | [INFO] [stdout] 275 | / if component.reference.starts_with('D') || [INFO] [stdout] 276 | | component.value.to_lowercase().contains("tvs") || [INFO] [stdout] 277 | | component.value.to_lowercase().contains("esd") { [INFO] [stdout] 278 | | return true; [INFO] [stdout] 279 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 274 ~ ExternalComponentType::ProtectionDiode [INFO] [stdout] 275 ~ if (component.reference.starts_with('D') || [INFO] [stdout] 276 | component.value.to_lowercase().contains("tvs") || [INFO] [stdout] 277 ~ component.value.to_lowercase().contains("esd")) => { [INFO] [stdout] 278 | return true; [INFO] [stdout] 279 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/datasheets/checker.rs:253:32 [INFO] [stdout] | [INFO] [stdout] 253 | ... if value >= 1000.0 && value <= 100_000.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(1000.0..=100_000.0).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: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/datasheets/checker.rs:268:32 [INFO] [stdout] | [INFO] [stdout] 268 | ... if value >= 20.0 && value <= 50.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(20.0..=50.0).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: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/datasheets/checker.rs:473:28 [INFO] [stdout] | [INFO] [stdout] 473 | if value >= 1000.0 && value <= 100_000.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(1000.0..=100_000.0).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: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/datasheets/checker.rs:623:16 [INFO] [stdout] | [INFO] [stdout] 623 | if num >= 1.0 && num <= 1000.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(1.0..=1000.0).contains(&num)` [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: wildcard pattern covers any other pattern as it will match anyway [INFO] [stdout] --> src/ai/router.rs:72:13 [INFO] [stdout] | [INFO] [stdout] 72 | "claude" | _ => { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider handling `_` separately [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_in_or_patterns [INFO] [stdout] = note: `#[warn(clippy::wildcard_in_or_patterns)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/ai/router.rs:133:31 [INFO] [stdout] | [INFO] [stdout] 133 | let active_provider = if let Some(provider) = self.get_provider().await { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 134 | | Some(provider.name().to_string()) [INFO] [stdout] 135 | | } else { [INFO] [stdout] 136 | | None [INFO] [stdout] 137 | | }; [INFO] [stdout] | |_________^ help: try: `self.get_provider().await.map(|provider| provider.name().to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/parser/kicad.rs:373:18 [INFO] [stdout] | [INFO] [stdout] 373 | .or_insert_with(HashSet::new); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/ai/classifier.rs:386:1 [INFO] [stdout] | [INFO] [stdout] 386 | / impl Default for ComponentRole { [INFO] [stdout] 387 | | fn default() -> Self { [INFO] [stdout] 388 | | ComponentRole::Unknown [INFO] [stdout] 389 | | } [INFO] [stdout] 390 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 28 + #[derive(Default)] [INFO] [stdout] 29 | pub enum ComponentRole { [INFO] [stdout] 30 | // Power Management [INFO] [stdout] ... [INFO] [stdout] 167 | GenericPassive, [INFO] [stdout] 168 ~ #[default] [INFO] [stdout] 169 ~ Unknown, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used consecutive `str::replace` call [INFO] [stdout] --> src/ai/classifier.rs:598:15 [INFO] [stdout] | [INFO] [stdout] 598 | s.replace('-', "").replace('_', "").replace('/', "").replace(':', "") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `replace(['-', '_', '/', ':'], "")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_str_replace [INFO] [stdout] = note: `#[warn(clippy::collapsible_str_replace)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/parser/pcb.rs:217:9 [INFO] [stdout] | [INFO] [stdout] 217 | / setup.copper_thickness = CopperThickness { [INFO] [stdout] 218 | | outer: 1.0, [INFO] [stdout] 219 | | inner: 0.5, [INFO] [stdout] 220 | | }; [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `parser::pcb_schema::PcbSetup { copper_thickness: CopperThickness { [INFO] [stdout] outer: 1.0, [INFO] [stdout] inner: 0.5, [INFO] [stdout] }, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/parser/pcb.rs:214:9 [INFO] [stdout] | [INFO] [stdout] 214 | let mut setup = PcbSetup::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/parser/pcb.rs:607:23 [INFO] [stdout] | [INFO] [stdout] 607 | let keepout = if let Some(ko_exp) = sexp.get("keepout") { [INFO] [stdout] | _______________________^ [INFO] [stdout] 608 | | Some(ZoneKeepout { [INFO] [stdout] 609 | | tracks: Self::get_string_value(ko_exp, "tracks") == Some("not_allowed".to_string()), [INFO] [stdout] 610 | | vias: Self::get_string_value(ko_exp, "vias") == Some("not_allowed".to_string()), [INFO] [stdout] ... | [INFO] [stdout] 616 | | None [INFO] [stdout] 617 | | }; [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 607 ~ let keepout = sexp.get("keepout").map(|ko_exp| ZoneKeepout { [INFO] [stdout] 608 + tracks: Self::get_string_value(ko_exp, "tracks") == Some("not_allowed".to_string()), [INFO] [stdout] 609 + vias: Self::get_string_value(ko_exp, "vias") == Some("not_allowed".to_string()), [INFO] [stdout] 610 + pads: Self::get_string_value(ko_exp, "pads") == Some("not_allowed".to_string()), [INFO] [stdout] 611 + copperpour: Self::get_string_value(ko_exp, "copperpour") == Some("not_allowed".to_string()), [INFO] [stdout] 612 + footprints: Self::get_string_value(ko_exp, "footprints") == Some("not_allowed".to_string()), [INFO] [stdout] 613 ~ }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/parser/pcb_schema.rs:56:1 [INFO] [stdout] | [INFO] [stdout] 56 | / impl Default for LayerType { [INFO] [stdout] 57 | | fn default() -> Self { [INFO] [stdout] 58 | | LayerType::Signal [INFO] [stdout] 59 | | } [INFO] [stdout] 60 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 47 + #[derive(Default)] [INFO] [stdout] 48 | pub enum LayerType { [INFO] [stdout] 49 ~ #[default] [INFO] [stdout] 50 ~ Signal, // Copper signal layer [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/parser/pcb_schema.rs:221:1 [INFO] [stdout] | [INFO] [stdout] 221 | / impl Default for ViaType { [INFO] [stdout] 222 | | fn default() -> Self { [INFO] [stdout] 223 | | ViaType::Through [INFO] [stdout] 224 | | } [INFO] [stdout] 225 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 214 + #[derive(Default)] [INFO] [stdout] 215 | pub enum ViaType { [INFO] [stdout] 216 ~ #[default] [INFO] [stdout] 217 ~ Through, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/parser/pcb_schema.rs:250:1 [INFO] [stdout] | [INFO] [stdout] 250 | / impl Default for ZoneConnectType { [INFO] [stdout] 251 | | fn default() -> Self { [INFO] [stdout] 252 | | ZoneConnectType::ThermalRelief [INFO] [stdout] 253 | | } [INFO] [stdout] 254 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 244 + #[derive(Default)] [INFO] [stdout] 245 | pub enum ZoneConnectType { [INFO] [stdout] 246 | Solid, [INFO] [stdout] 247 ~ #[default] [INFO] [stdout] 248 ~ ThermalRelief, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/parser/pcb_schema.rs:333:1 [INFO] [stdout] | [INFO] [stdout] 333 | / impl Default for PcbDesign { [INFO] [stdout] 334 | | fn default() -> Self { [INFO] [stdout] 335 | | Self { [INFO] [stdout] 336 | | uuid: String::new(), [INFO] [stdout] ... | [INFO] [stdout] 350 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 11 + #[derive(Default)] [INFO] [stdout] 12 | pub struct PcbDesign { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/parser/netlist.rs:243:47 [INFO] [stdout] | [INFO] [stdout] 243 | pin_to_net.entry(key).or_insert_with(Vec::new).push(PinNetConnection { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/parser/netlist.rs:324:12 [INFO] [stdout] | [INFO] [stdout] 324 | if t < 0.0 || t > 1.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: use: `!(0.0..=1.0).contains(&t)` [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: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/parser/kicad_legacy.rs:284:9 [INFO] [stdout] | [INFO] [stdout] 284 | general.thickness = 1.6; // sensible default [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `parser::pcb_schema::PcbGeneral { thickness: 1.6, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/parser/kicad_legacy.rs:283:9 [INFO] [stdout] | [INFO] [stdout] 283 | let mut general = PcbGeneral::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/parser/kicad_legacy.rs:337:29 [INFO] [stdout] | [INFO] [stdout] 337 | / ... if setup.track_width == 0.0 { [INFO] [stdout] 338 | | ... setup.track_width = pcb_coord(val, unit_factor); [INFO] [stdout] 339 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 336 ~ "TrackWidth" [INFO] [stdout] 337 ~ if setup.track_width == 0.0 => { [INFO] [stdout] 338 | setup.track_width = pcb_coord(val, unit_factor); [INFO] [stdout] 339 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:378:28 [INFO] [stdout] | [INFO] [stdout] 378 | let rest = &line[3..]; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:376:13 [INFO] [stdout] | [INFO] [stdout] 376 | if line.starts_with("Na ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] = note: `#[warn(clippy::manual_strip)]` on by default [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 376 ~ if let Some(rest) = line.strip_prefix("Na ") { [INFO] [stdout] 377 | // Format: Na "" [INFO] [stdout] 378 ~ let parts: Vec<&str> = rest.splitn(2, ' ').collect(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:423:40 [INFO] [stdout] | [INFO] [stdout] 423 | let parts: Vec<&str> = line[3..].split_whitespace().collect(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:421:13 [INFO] [stdout] | [INFO] [stdout] 421 | if line.starts_with("Po ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 421 ~ if let Some() = line.strip_prefix("Po ") { [INFO] [stdout] 422 | // Po x y orient layer timestamp attr [INFO] [stdout] 423 ~ let parts: Vec<&str> = .split_whitespace().collect(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:437:36 [INFO] [stdout] | [INFO] [stdout] 437 | fp.footprint_lib = line[3..].trim().to_string(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:436:20 [INFO] [stdout] | [INFO] [stdout] 436 | } else if line.starts_with("Li ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 436 ~ } else if let Some() = line.strip_prefix("Li ") { [INFO] [stdout] 437 ~ fp.footprint_lib = .trim().to_string(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:448:56 [INFO] [stdout] | [INFO] [stdout] 448 | .insert("Description".to_string(), line[3..].trim().to_string()); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:446:20 [INFO] [stdout] | [INFO] [stdout] 446 | } else if line.starts_with("Cd ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 446 ~ } else if let Some() = line.strip_prefix("Cd ") { [INFO] [stdout] 447 | fp.properties [INFO] [stdout] 448 ~ .insert("Description".to_string(), .trim().to_string()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:451:53 [INFO] [stdout] | [INFO] [stdout] 451 | .insert("Keywords".to_string(), line[3..].trim().to_string()); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:449:20 [INFO] [stdout] | [INFO] [stdout] 449 | } else if line.starts_with("Kw ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 449 ~ } else if let Some() = line.strip_prefix("Kw ") { [INFO] [stdout] 450 | fp.properties [INFO] [stdout] 451 ~ .insert("Keywords".to_string(), .trim().to_string()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:497:28 [INFO] [stdout] | [INFO] [stdout] 497 | let rest = &line[3..]; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:495:13 [INFO] [stdout] | [INFO] [stdout] 495 | if line.starts_with("Sh ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 495 ~ if let Some(rest) = line.strip_prefix("Sh ") { [INFO] [stdout] 496 | // Sh "number" shape width height dx dy orient [INFO] [stdout] 497 ~ if let Some(start) = rest.find('"') { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:520:40 [INFO] [stdout] | [INFO] [stdout] 520 | let parts: Vec<&str> = line[3..].split_whitespace().collect(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:518:20 [INFO] [stdout] | [INFO] [stdout] 518 | } else if line.starts_with("Dr ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 518 ~ } else if let Some() = line.strip_prefix("Dr ") { [INFO] [stdout] 519 | // Dr diameter offset_x offset_y [INFO] [stdout] 520 ~ let parts: Vec<&str> = .split_whitespace().collect(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:546:40 [INFO] [stdout] | [INFO] [stdout] 546 | let parts: Vec<&str> = line[3..].split_whitespace().collect(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:544:20 [INFO] [stdout] | [INFO] [stdout] 544 | } else if line.starts_with("At ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 544 ~ } else if let Some() = line.strip_prefix("At ") { [INFO] [stdout] 545 | // At type N layer_mask [INFO] [stdout] 546 ~ let parts: Vec<&str> = .split_whitespace().collect(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:552:28 [INFO] [stdout] | [INFO] [stdout] 552 | let rest = &line[3..]; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:550:20 [INFO] [stdout] | [INFO] [stdout] 550 | } else if line.starts_with("Ne ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 550 ~ } else if let Some(rest) = line.strip_prefix("Ne ") { [INFO] [stdout] 551 | // Ne net_number "net_name" [INFO] [stdout] 552 ~ let parts: Vec<&str> = rest.splitn(2, ' ').collect(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:562:40 [INFO] [stdout] | [INFO] [stdout] 562 | let parts: Vec<&str> = line[3..].split_whitespace().collect(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:560:20 [INFO] [stdout] | [INFO] [stdout] 560 | } else if line.starts_with("Po ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 560 ~ } else if let Some() = line.strip_prefix("Po ") { [INFO] [stdout] 561 | // Po x y (pad position relative to module) [INFO] [stdout] 562 ~ let parts: Vec<&str> = .split_whitespace().collect(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:572:47 [INFO] [stdout] | [INFO] [stdout] 572 | pad.layers = parse_layer_mask(line[3..].trim()); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:571:20 [INFO] [stdout] | [INFO] [stdout] 571 | } else if line.starts_with("La ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 571 ~ } else if let Some() = line.strip_prefix("La ") { [INFO] [stdout] 572 ~ pad.layers = parse_layer_mask(.trim()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:614:43 [INFO] [stdout] | [INFO] [stdout] 614 | let po_parts: Vec<&str> = line[3..].split_whitespace().collect(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:613:13 [INFO] [stdout] | [INFO] [stdout] 613 | if line.starts_with("Po ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 613 ~ if let Some() = line.strip_prefix("Po ") { [INFO] [stdout] 614 ~ let po_parts: Vec<&str> = .split_whitespace().collect(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:620:51 [INFO] [stdout] | [INFO] [stdout] 620 | let de_parts: Vec<&str> = de_line[3..].split_whitespace().collect(); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:619:21 [INFO] [stdout] | [INFO] [stdout] 619 | if de_line.starts_with("De ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 619 ~ if let Some() = de_line.strip_prefix("De ") { [INFO] [stdout] 620 ~ let de_parts: Vec<&str> = .split_whitespace().collect(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:728:33 [INFO] [stdout] | [INFO] [stdout] 728 | let layer_num = line[7..].trim().parse::().unwrap_or(0); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:727:20 [INFO] [stdout] | [INFO] [stdout] 727 | } else if line.starts_with("ZLayer ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 727 ~ } else if let Some() = line.strip_prefix("ZLayer ") { [INFO] [stdout] 728 ~ let layer_num = .trim().parse::().unwrap_or(0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:731:27 [INFO] [stdout] | [INFO] [stdout] 731 | let val = line[14..].trim().parse::().unwrap_or(0.0); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:730:20 [INFO] [stdout] | [INFO] [stdout] 730 | } else if line.starts_with("ZMinThickness ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 730 ~ } else if let Some() = line.strip_prefix("ZMinThickness ") { [INFO] [stdout] 731 ~ let val = .trim().parse::().unwrap_or(0.0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:734:33 [INFO] [stdout] | [INFO] [stdout] 734 | zone.priority = line[10..].trim().parse::().unwrap_or(0); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:733:20 [INFO] [stdout] | [INFO] [stdout] 733 | } else if line.starts_with("ZPriority ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 733 ~ } else if let Some() = line.strip_prefix("ZPriority ") { [INFO] [stdout] 734 ~ zone.priority = .trim().parse::().unwrap_or(0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:736:43 [INFO] [stdout] | [INFO] [stdout] 736 | zone.connect_pads = match line[17..].trim() { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:735:20 [INFO] [stdout] | [INFO] [stdout] 735 | } else if line.starts_with("ZConnectPadsType ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 735 ~ } else if let Some() = line.strip_prefix("ZConnectPadsType ") { [INFO] [stdout] 736 ~ zone.connect_pads = match .trim() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:742:40 [INFO] [stdout] | [INFO] [stdout] 742 | let parts: Vec<&str> = line[8..].split_whitespace().collect(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:741:20 [INFO] [stdout] | [INFO] [stdout] 741 | } else if line.starts_with("ZCorner ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 741 ~ } else if let Some() = line.strip_prefix("ZCorner ") { [INFO] [stdout] 742 ~ let parts: Vec<&str> = .split_whitespace().collect(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:813:40 [INFO] [stdout] | [INFO] [stdout] 813 | let parts: Vec<&str> = line[3..].split_whitespace().collect(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:811:13 [INFO] [stdout] | [INFO] [stdout] 811 | if line.starts_with("Po ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 811 ~ if let Some() = line.strip_prefix("Po ") { [INFO] [stdout] 812 | // Po shape x1 y1 x2 y2 width [INFO] [stdout] 813 ~ let parts: Vec<&str> = .split_whitespace().collect(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:840:40 [INFO] [stdout] | [INFO] [stdout] 840 | let parts: Vec<&str> = line[3..].split_whitespace().collect(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:839:20 [INFO] [stdout] | [INFO] [stdout] 839 | } else if line.starts_with("De ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 839 ~ } else if let Some() = line.strip_prefix("De ") { [INFO] [stdout] 840 ~ let parts: Vec<&str> = .split_whitespace().collect(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:895:40 [INFO] [stdout] | [INFO] [stdout] 895 | let parts: Vec<&str> = line[2..].split_whitespace().collect(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:893:13 [INFO] [stdout] | [INFO] [stdout] 893 | if line.starts_with("L ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 893 ~ if let Some() = line.strip_prefix("L ") { [INFO] [stdout] 894 | // L Library:Component Reference [INFO] [stdout] 895 ~ let parts: Vec<&str> = .split_whitespace().collect(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:910:40 [INFO] [stdout] | [INFO] [stdout] 910 | let parts: Vec<&str> = line[2..].split_whitespace().collect(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:908:20 [INFO] [stdout] | [INFO] [stdout] 908 | } else if line.starts_with("U ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 908 ~ } else if let Some() = line.strip_prefix("U ") { [INFO] [stdout] 909 | // U unit convert timestamp [INFO] [stdout] 910 ~ let parts: Vec<&str> = .split_whitespace().collect(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:919:40 [INFO] [stdout] | [INFO] [stdout] 919 | let parts: Vec<&str> = line[2..].split_whitespace().collect(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:917:20 [INFO] [stdout] | [INFO] [stdout] 917 | } else if line.starts_with("P ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 917 ~ } else if let Some() = line.strip_prefix("P ") { [INFO] [stdout] 918 | // P X Y [INFO] [stdout] 919 ~ let parts: Vec<&str> = .split_whitespace().collect(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/kicad_legacy.rs:928:28 [INFO] [stdout] | [INFO] [stdout] 928 | let rest = &line[2..]; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/kicad_legacy.rs:925:20 [INFO] [stdout] | [INFO] [stdout] 925 | } else if line.starts_with("F ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 925 ~ } else if let Some(rest) = line.strip_prefix("F ") { [INFO] [stdout] 926 | // F field_num "text" orientation X Y size flags hjust vjust style "fieldname" [INFO] [stdout] 927 | // Parse more carefully - text may contain spaces [INFO] [stdout] 928 ~ let mut parts = rest.split_whitespace(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: found call to `str::trim` before `str::split_whitespace` [INFO] [stdout] --> src/parser/kicad_legacy.rs:964:45 [INFO] [stdout] | [INFO] [stdout] 964 | let parts: Vec<&str> = line.trim().split_whitespace().collect(); [INFO] [stdout] | ^^^^^^^ help: remove `trim()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trim_split_whitespace [INFO] [stdout] = note: `#[warn(clippy::trim_split_whitespace)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/parser/kicad_legacy.rs:965:20 [INFO] [stdout] | [INFO] [stdout] 965 | if parts.len() >= 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!parts.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: length comparison to zero [INFO] [stdout] --> src/parser/kicad_legacy.rs:1035:19 [INFO] [stdout] | [INFO] [stdout] 1035 | } else if text.len() > 0 && text.chars().next().unwrap().is_uppercase() { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!text.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] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/parser/kicad_legacy.rs:1065:37 [INFO] [stdout] | [INFO] [stdout] 1065 | net_map.entry(net_name).or_insert_with(HashSet::new); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/parser/format_detector.rs:128:18 [INFO] [stdout] | [INFO] [stdout] 128 | .map_err(|e| KicadParseError::Io(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `KicadParseError::Io` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/parser/format_detector.rs:155:18 [INFO] [stdout] | [INFO] [stdout] 155 | .map_err(|e| PcbParseError::Io(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `PcbParseError::Io` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/ucs/schema.rs:28:1 [INFO] [stdout] | [INFO] [stdout] 28 | / impl Default for SourceCAD { [INFO] [stdout] 29 | | fn default() -> Self { [INFO] [stdout] 30 | | SourceCAD::Unknown [INFO] [stdout] 31 | | } [INFO] [stdout] 32 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 18 + #[derive(Default)] [INFO] [stdout] 19 | pub enum SourceCAD { [INFO] [stdout] 20 | KiCad, [INFO] [stdout] ... [INFO] [stdout] 25 | EDIF, [INFO] [stdout] 26 ~ #[default] [INFO] [stdout] 27 ~ Unknown, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/ucs/schema.rs:116:1 [INFO] [stdout] | [INFO] [stdout] 116 | / impl Default for ElectricalType { [INFO] [stdout] 117 | | fn default() -> Self { [INFO] [stdout] 118 | | ElectricalType::Unspecified [INFO] [stdout] 119 | | } [INFO] [stdout] 120 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 102 + #[derive(Default)] [INFO] [stdout] 103 | pub enum ElectricalType { [INFO] [stdout] 104 | Input, [INFO] [stdout] ... [INFO] [stdout] 113 | NoConnect, [INFO] [stdout] 114 ~ #[default] [INFO] [stdout] 115 ~ Unspecified, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/ucs/schema.rs:445:1 [INFO] [stdout] | [INFO] [stdout] 445 | / impl Default for SignalType { [INFO] [stdout] 446 | | fn default() -> Self { [INFO] [stdout] 447 | | SignalType::Unknown [INFO] [stdout] 448 | | } [INFO] [stdout] 449 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 432 + #[derive(Default)] [INFO] [stdout] 433 | pub enum SignalType { [INFO] [stdout] 434 | Analog, [INFO] [stdout] ... [INFO] [stdout] 442 | Control, [INFO] [stdout] 443 ~ #[default] [INFO] [stdout] 444 ~ Unknown, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `result` after checking its variant with `is_ok` [INFO] [stdout] --> tests/parser_tests.rs:64:19 [INFO] [stdout] | [INFO] [stdout] 63 | if result.is_ok() { [INFO] [stdout] | ----------------- help: try: `if let Ok() = result` [INFO] [stdout] 64 | let pcb = result.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this manual char comparison can be written more succinctly [INFO] [stdout] --> src/ucs/circuit.rs:397:45 [INFO] [stdout] | [INFO] [stdout] 397 | .trim_start_matches(|c: char| c == '-' || c == '_') [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an array of `char`: `['-', '_']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison [INFO] [stdout] = note: `#[warn(clippy::manual_pattern_char_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ucs/analysis.rs:419:25 [INFO] [stdout] | [INFO] [stdout] 419 | fn find_other_side_nets<'a>( [INFO] [stdout] | ^^ [INFO] [stdout] 420 | circuit: &'a Circuit, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 419 ~ fn find_other_side_nets( [INFO] [stdout] 420 ~ circuit: &Circuit, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: wildcard pattern covers any other pattern as it will match anyway [INFO] [stdout] --> src/ai/router.rs:72:13 [INFO] [stdout] | [INFO] [stdout] 72 | "claude" | _ => { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider handling `_` separately [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_in_or_patterns [INFO] [stdout] = note: `#[warn(clippy::wildcard_in_or_patterns)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/ai/router.rs:133:31 [INFO] [stdout] | [INFO] [stdout] 133 | let active_provider = if let Some(provider) = self.get_provider().await { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 134 | | Some(provider.name().to_string()) [INFO] [stdout] 135 | | } else { [INFO] [stdout] 136 | | None [INFO] [stdout] 137 | | }; [INFO] [stdout] | |_________^ help: try: `self.get_provider().await.map(|provider| provider.name().to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/ai/classifier.rs:386:1 [INFO] [stdout] | [INFO] [stdout] 386 | / impl Default for ComponentRole { [INFO] [stdout] 387 | | fn default() -> Self { [INFO] [stdout] 388 | | ComponentRole::Unknown [INFO] [stdout] 389 | | } [INFO] [stdout] 390 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 28 + #[derive(Default)] [INFO] [stdout] 29 | pub enum ComponentRole { [INFO] [stdout] 30 | // Power Management [INFO] [stdout] ... [INFO] [stdout] 167 | GenericPassive, [INFO] [stdout] 168 ~ #[default] [INFO] [stdout] 169 ~ Unknown, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used consecutive `str::replace` call [INFO] [stdout] --> src/ai/classifier.rs:598:15 [INFO] [stdout] | [INFO] [stdout] 598 | s.replace('-', "").replace('_', "").replace('/', "").replace(':', "") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `replace(['-', '_', '/', ':'], "")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_str_replace [INFO] [stdout] = note: `#[warn(clippy::collapsible_str_replace)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 46.79s [INFO] running `Command { std: "docker" "inspect" "701b41f9894d0504470024c6ef1c2a8823a0afd92c2994bd374a8b7b8f33095d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "701b41f9894d0504470024c6ef1c2a8823a0afd92c2994bd374a8b7b8f33095d", kill_on_drop: false }` [INFO] [stdout] 701b41f9894d0504470024c6ef1c2a8823a0afd92c2994bd374a8b7b8f33095d