[INFO] cloning repository https://github.com/AlchemicalChef/skillguard [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/AlchemicalChef/skillguard" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FAlchemicalChef%2Fskillguard", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FAlchemicalChef%2Fskillguard'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 735e4b958eb5a98d7a1ea042a013883b726ec334 [INFO] linting AlchemicalChef/skillguard against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FAlchemicalChef%2Fskillguard" "/workspace/builds/worker-6-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-6-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/AlchemicalChef/skillguard [INFO] finished tweaking git repo https://github.com/AlchemicalChef/skillguard [INFO] tweaked toml for git repo https://github.com/AlchemicalChef/skillguard written to /workspace/builds/worker-6-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/AlchemicalChef/skillguard on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/AlchemicalChef/skillguard already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded wasm-bindgen-shared v0.2.110 [INFO] [stderr] Downloaded wasm-bindgen v0.2.110 [INFO] [stderr] Downloaded wasm-bindgen-macro v0.2.110 [INFO] [stderr] Downloaded wasm-bindgen-macro-support v0.2.110 [INFO] [stderr] Downloaded js-sys v0.3.87 [INFO] [stderr] Downloaded web-sys v0.3.87 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-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] 508021a69ce4dc7248746a74c09767c18cad805b670540cd2fd4ed9942c697a3 [INFO] running `Command { std: "docker" "start" "-a" "508021a69ce4dc7248746a74c09767c18cad805b670540cd2fd4ed9942c697a3", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "508021a69ce4dc7248746a74c09767c18cad805b670540cd2fd4ed9942c697a3", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "508021a69ce4dc7248746a74c09767c18cad805b670540cd2fd4ed9942c697a3", kill_on_drop: false }` [INFO] [stdout] 508021a69ce4dc7248746a74c09767c18cad805b670540cd2fd4ed9942c697a3 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-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] 13f9f18c244ca58ac740c10f6c1c70f1c37fa05cc9e236e6064886374a3ee5c8 [INFO] running `Command { std: "docker" "start" "-a" "13f9f18c244ca58ac740c10f6c1c70f1c37fa05cc9e236e6064886374a3ee5c8", kill_on_drop: false }` [INFO] [stderr] Compiling quote v1.0.44 [INFO] [stderr] Compiling serde_core v1.0.228 [INFO] [stderr] Compiling libc v0.2.182 [INFO] [stderr] Compiling serde v1.0.228 [INFO] [stderr] Compiling num-traits v0.2.19 [INFO] [stderr] Compiling getrandom v0.4.1 [INFO] [stderr] Compiling thiserror v2.0.18 [INFO] [stderr] Checking iana-time-zone v0.1.65 [INFO] [stderr] Checking tracing-core v0.1.36 [INFO] [stderr] Checking aho-corasick v1.1.4 [INFO] [stderr] Checking regex-syntax v0.8.9 [INFO] [stderr] Checking smallvec v1.15.1 [INFO] [stderr] Compiling syn v2.0.117 [INFO] [stderr] Compiling ucd-trie v0.1.7 [INFO] [stderr] Compiling memchr v2.8.0 [INFO] [stderr] Checking indexmap v2.13.0 [INFO] [stderr] Checking hashbrown v0.14.5 [INFO] [stderr] Compiling pest v2.8.6 [INFO] [stderr] Checking fixedbitset v0.5.7 [INFO] [stderr] Checking parking_lot_core v0.9.12 [INFO] [stderr] Checking errno v0.3.14 [INFO] [stderr] Checking socket2 v0.6.2 [INFO] [stderr] Checking signal-hook-registry v1.4.8 [INFO] [stderr] Checking parking_lot v0.12.5 [INFO] [stderr] Checking mio v1.1.1 [INFO] [stderr] Checking dashmap v6.1.0 [INFO] [stderr] Checking petgraph v0.7.1 [INFO] [stderr] Checking regex-automata v0.4.14 [INFO] [stderr] Checking crossbeam-queue v0.3.12 [INFO] [stderr] Checking crossbeam-channel v0.5.15 [INFO] [stderr] Checking glob v0.3.3 [INFO] [stderr] Checking ipnet v2.11.0 [INFO] [stderr] Checking serde_json v1.0.149 [INFO] [stderr] Checking uuid v1.21.0 [INFO] [stderr] Compiling pest_meta v2.8.6 [INFO] [stderr] Checking crossbeam v0.8.4 [INFO] [stderr] Checking anstream v0.6.21 [INFO] [stderr] Checking clap_lex v1.0.0 [INFO] [stderr] Compiling zerocopy v0.8.39 [INFO] [stderr] Checking tracing-log v0.2.0 [INFO] [stderr] Checking clap_builder v4.5.60 [INFO] [stderr] Checking thread_local v1.1.9 [INFO] [stderr] Checking nu-ansi-term v0.50.3 [INFO] [stderr] Compiling rayon-core v1.13.0 [INFO] [stderr] Checking plotters-backend v0.3.7 [INFO] [stderr] Checking ciborium-io v0.2.2 [INFO] [stderr] Checking itertools v0.10.5 [INFO] [stderr] Checking plotters-svg v0.3.7 [INFO] [stderr] Checking cast v0.3.0 [INFO] [stderr] Checking winnow v0.7.14 [INFO] [stderr] Checking toml_write v0.1.2 [INFO] [stderr] Checking rayon v1.11.0 [INFO] [stderr] Checking walkdir v2.5.0 [INFO] [stderr] Checking plotters v0.3.7 [INFO] [stderr] Compiling pest_generator v2.8.6 [INFO] [stderr] Checking criterion-plot v0.5.0 [INFO] [stderr] Checking is-terminal v0.4.17 [INFO] [stderr] Checking regex v1.12.3 [INFO] [stderr] Checking matchers v0.2.0 [INFO] [stderr] Checking oorandom v11.1.5 [INFO] [stderr] Checking anes v0.1.6 [INFO] [stderr] Compiling serde_derive v1.0.228 [INFO] [stderr] Compiling thiserror-impl v2.0.18 [INFO] [stderr] Compiling tracing-attributes v0.1.31 [INFO] [stderr] Compiling tokio-macros v2.6.0 [INFO] [stderr] Compiling clap_derive v4.5.55 [INFO] [stderr] Compiling pest_derive v2.8.6 [INFO] [stderr] Compiling zerocopy-derive v0.8.39 [INFO] [stderr] Checking tokio v1.49.0 [INFO] [stderr] Checking tracing v0.1.44 [INFO] [stderr] Checking clap v4.5.60 [INFO] [stderr] Checking chrono v0.4.43 [INFO] [stderr] Checking tracing-serde v0.2.0 [INFO] [stderr] Checking toml_datetime v0.6.11 [INFO] [stderr] Checking serde_spanned v0.6.9 [INFO] [stderr] Checking tinytemplate v1.2.1 [INFO] [stderr] Checking tracing-subscriber v0.3.22 [INFO] [stderr] Checking toml_edit v0.22.27 [INFO] [stderr] Checking sg-events v0.1.0 (/opt/rustwide/workdir/crates/sg-events) [INFO] [stderr] Checking toml v0.8.23 [INFO] [stderr] Checking half v2.7.1 [INFO] [stderr] Checking ciborium-ll v0.2.2 [INFO] [stderr] Checking ciborium v0.2.2 [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> crates/sg-events/src/severity.rs:85:1 [INFO] [stdout] | [INFO] [stdout] 85 | / impl Default for Severity { [INFO] [stdout] 86 | | fn default() -> Self { [INFO] [stdout] 87 | | Self::Info [INFO] [stdout] 88 | | } [INFO] [stdout] 89 | | } [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 and mark the default variant [INFO] [stdout] | [INFO] [stdout] 26 + #[derive(Default)] [INFO] [stdout] 27 | pub enum Severity { [INFO] [stdout] 28 | /// Informational, no risk. [INFO] [stdout] 29 ~ #[default] [INFO] [stdout] 30 ~ Info, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking criterion v0.5.1 [INFO] [stderr] Checking sg-dsl v0.1.0 (/opt/rustwide/workdir/crates/sg-dsl) [INFO] [stderr] Checking sg-taint v0.1.0 (/opt/rustwide/workdir/crates/sg-taint) [INFO] [stderr] Checking sg-probes v0.1.0 (/opt/rustwide/workdir/crates/sg-probes) [INFO] [stderr] Checking sg-threat-intel v0.1.0 (/opt/rustwide/workdir/crates/sg-threat-intel) [INFO] [stderr] Checking sg-integrity v0.1.0 (/opt/rustwide/workdir/crates/sg-integrity) [INFO] [stderr] Checking sg-supply-chain v0.1.0 (/opt/rustwide/workdir/crates/sg-supply-chain) [INFO] [stderr] Checking sg-sandbox v0.1.0 (/opt/rustwide/workdir/crates/sg-sandbox) [INFO] [stderr] Checking sg-fingerprint v0.1.0 (/opt/rustwide/workdir/crates/sg-fingerprint) [INFO] [stderr] Checking sg-nlp v0.1.0 (/opt/rustwide/workdir/crates/sg-nlp) [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> crates/sg-events/src/severity.rs:85:1 [INFO] [stdout] | [INFO] [stdout] 85 | / impl Default for Severity { [INFO] [stdout] 86 | | fn default() -> Self { [INFO] [stdout] 87 | | Self::Info [INFO] [stdout] 88 | | } [INFO] [stdout] 89 | | } [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 and mark the default variant [INFO] [stdout] | [INFO] [stdout] 26 + #[derive(Default)] [INFO] [stdout] 27 | pub enum Severity { [INFO] [stdout] 28 | /// Informational, no risk. [INFO] [stdout] 29 ~ #[default] [INFO] [stdout] 30 ~ Info, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> crates/sg-supply-chain/src/typosquat_detector.rs:185:71 [INFO] [stdout] | [INFO] [stdout] 185 | let suspect_stripped = suspect.strip_prefix('@').and_then(|s| s.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] 185 - let suspect_stripped = suspect.strip_prefix('@').and_then(|s| s.split('/').last()); [INFO] [stdout] 185 + let suspect_stripped = suspect.strip_prefix('@').and_then(|s| s.split('/').next_back()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> crates/sg-supply-chain/src/typosquat_detector.rs:186:69 [INFO] [stdout] | [INFO] [stdout] 186 | let target_stripped = target.strip_prefix('@').and_then(|s| s.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] help: try [INFO] [stdout] | [INFO] [stdout] 186 - let target_stripped = target.strip_prefix('@').and_then(|s| s.split('/').last()); [INFO] [stdout] 186 + let target_stripped = target.strip_prefix('@').and_then(|s| s.split('/').next_back()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `match` [INFO] [stdout] --> crates/sg-fingerprint/src/extractor.rs:161:21 [INFO] [stdout] | [INFO] [stdout] 161 | / if let sg_events::NetworkEvent::DataTransfer { [INFO] [stdout] 162 | | bytes_transferred, .. [INFO] [stdout] 163 | | } = net [INFO] [stdout] ... | [INFO] [stdout] 166 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> crates/sg-fingerprint/src/extractor.rs:160:50 [INFO] [stdout] | [INFO] [stdout] 160 | sg_events::EventPayload::Network(net) => { [INFO] [stdout] | ^^^ replace this binding [INFO] [stdout] 161 | if let sg_events::NetworkEvent::DataTransfer { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 162 | | bytes_transferred, .. [INFO] [stdout] 163 | | } = net [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 `if let` can be collapsed into the outer `match` [INFO] [stdout] --> crates/sg-fingerprint/src/extractor.rs:169:21 [INFO] [stdout] | [INFO] [stdout] 169 | / if let sg_events::SyscallEvent::FileOpen { path, .. } = syscall { [INFO] [stdout] 170 | | files_seen.insert(path.to_string_lossy().to_string()); [INFO] [stdout] 171 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> crates/sg-fingerprint/src/extractor.rs:168:50 [INFO] [stdout] | [INFO] [stdout] 168 | sg_events::EventPayload::Syscall(syscall) => { [INFO] [stdout] | ^^^^^^^ replace this binding [INFO] [stdout] 169 | if let sg_events::SyscallEvent::FileOpen { path, .. } = syscall { [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] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `match` [INFO] [stdout] --> crates/sg-taint/src/lazy_taint.rs:175:17 [INFO] [stdout] | [INFO] [stdout] 175 | / if let Some(p) = path { [INFO] [stdout] 176 | | let path_str = p.to_string_lossy(); [INFO] [stdout] 177 | | path_str.contains(".ssh/id_") [INFO] [stdout] 178 | | || path_str.contains(".aws/credentials") [INFO] [stdout] ... | [INFO] [stdout] 182 | | false [INFO] [stdout] 183 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> crates/sg-taint/src/lazy_taint.rs:174:60 [INFO] [stdout] | [INFO] [stdout] 174 | EventPayload::Syscall(SyscallEvent::FileRead { path, .. }) => { [INFO] [stdout] | ^^^^ replace this binding [INFO] [stdout] 175 | if let Some(p) = path { [INFO] [stdout] | ^^^^^^^ with this pattern, prefixed by `path: ` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> crates/sg-taint/src/propagation.rs:34:20 [INFO] [stdout] | [INFO] [stdout] 34 | pub detect_fn: Box bool + Send + Sync>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's values [INFO] [stdout] --> crates/sg-taint/src/propagation.rs:208:24 [INFO] [stdout] | [INFO] [stdout] 208 | for (_, tv) in &self.tainted_values { [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] 208 - for (_, tv) in &self.tainted_values { [INFO] [stdout] 208 + for tv in self.tainted_values.values() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's values [INFO] [stdout] --> crates/sg-taint/src/propagation.rs:247:28 [INFO] [stdout] | [INFO] [stdout] 247 | for (_, tv) in &self.tainted_values { [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] 247 - for (_, tv) in &self.tainted_values { [INFO] [stdout] 247 + for tv in self.tainted_values.values() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking sg-semantic v0.1.0 (/opt/rustwide/workdir/crates/sg-semantic) [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> crates/sg-threat-intel/src/indicators.rs:224:9 [INFO] [stdout] | [INFO] [stdout] 224 | / if let Some(entry) = self.lookup(IocType::IpAddress, ip) { [INFO] [stdout] 225 | | Some(IocMatch { [INFO] [stdout] 226 | | observed_value: ip.to_string(), [INFO] [stdout] 227 | | matched_ioc: entry.clone(), [INFO] [stdout] ... | [INFO] [stdout] 232 | | None [INFO] [stdout] 233 | | } [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] 224 ~ self.lookup(IocType::IpAddress, ip).map(|entry| IocMatch { [INFO] [stdout] 225 + observed_value: ip.to_string(), [INFO] [stdout] 226 + matched_ioc: entry.clone(), [INFO] [stdout] 227 + matched_at: Utc::now(), [INFO] [stdout] 228 + context: context.to_string(), [INFO] [stdout] 229 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> crates/sg-threat-intel/src/indicators.rs:264:9 [INFO] [stdout] | [INFO] [stdout] 264 | / if let Some(entry) = self.lookup(IocType::FileHash, hash) { [INFO] [stdout] 265 | | Some(IocMatch { [INFO] [stdout] 266 | | observed_value: hash.to_string(), [INFO] [stdout] 267 | | matched_ioc: entry.clone(), [INFO] [stdout] ... | [INFO] [stdout] 272 | | None [INFO] [stdout] 273 | | } [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] help: try [INFO] [stdout] | [INFO] [stdout] 264 ~ self.lookup(IocType::FileHash, hash).map(|entry| IocMatch { [INFO] [stdout] 265 + observed_value: hash.to_string(), [INFO] [stdout] 266 + matched_ioc: entry.clone(), [INFO] [stdout] 267 + matched_at: Utc::now(), [INFO] [stdout] 268 + context: context.to_string(), [INFO] [stdout] 269 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a suffix manually [INFO] [stdout] --> crates/sg-taint/src/transform_chain.rs:358:36 [INFO] [stdout] | [INFO] [stdout] 358 | let before_colon = before_trimmed[..before_trimmed.len() - 1].trim_end(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the suffix was tested here [INFO] [stdout] --> crates/sg-taint/src/transform_chain.rs:357:13 [INFO] [stdout] | [INFO] [stdout] 357 | if before_trimmed.ends_with(':') { [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_suffix` method [INFO] [stdout] | [INFO] [stdout] 357 ~ if let Some() = before_trimmed.strip_suffix(':') { [INFO] [stdout] 358 ~ let before_colon = .trim_end(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> crates/sg-taint/src/transform_chain.rs:383:9 [INFO] [stdout] | [INFO] [stdout] 383 | / if let Some(start) = source.find(target) { [INFO] [stdout] 384 | | Some(Transform::Substring { [INFO] [stdout] 385 | | start, [INFO] [stdout] 386 | | end: start + target.len(), [INFO] [stdout] ... | [INFO] [stdout] 389 | | None [INFO] [stdout] 390 | | } [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] 383 ~ source.find(target).map(|start| Transform::Substring { [INFO] [stdout] 384 + start, [INFO] [stdout] 385 + end: start + target.len(), [INFO] [stdout] 386 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> crates/sg-taint/src/transform_chain.rs:406:44 [INFO] [stdout] | [INFO] [stdout] 406 | let mut result = String::with_capacity((bytes.len() + 2) / 3 * 4); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `bytes.len().div_ceil(3)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> crates/sg-taint/src/transform_chain.rs:572:5 [INFO] [stdout] | [INFO] [stdout] 572 | / match (prev, next) { [INFO] [stdout] 573 | | (Some(Transform::Base64Encode), Transform::Base64Decode) => true, [INFO] [stdout] 574 | | (Some(Transform::Base64Decode), Transform::Base64Encode) => true, [INFO] [stdout] 575 | | (Some(Transform::UrlEncode), Transform::UrlDecode) => true, [INFO] [stdout] ... | [INFO] [stdout] 579 | | _ => false, [INFO] [stdout] 580 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 572 - match (prev, next) { [INFO] [stdout] 573 - (Some(Transform::Base64Encode), Transform::Base64Decode) => true, [INFO] [stdout] 574 - (Some(Transform::Base64Decode), Transform::Base64Encode) => true, [INFO] [stdout] 575 - (Some(Transform::UrlEncode), Transform::UrlDecode) => true, [INFO] [stdout] 576 - (Some(Transform::UrlDecode), Transform::UrlEncode) => true, [INFO] [stdout] 577 - (Some(Transform::HexEncode), Transform::HexDecode) => true, [INFO] [stdout] 578 - (Some(Transform::HexDecode), Transform::HexEncode) => true, [INFO] [stdout] 579 - _ => false, [INFO] [stdout] 580 - } [INFO] [stdout] 572 + matches!((prev, next), (Some(Transform::Base64Encode), Transform::Base64Decode) | (Some(Transform::Base64Decode), Transform::Base64Encode) | (Some(Transform::UrlEncode), Transform::UrlDecode) | (Some(Transform::UrlDecode), Transform::UrlEncode) | (Some(Transform::HexEncode), Transform::HexDecode) | (Some(Transform::HexDecode), Transform::HexEncode)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> crates/sg-threat-intel/src/reputation.rs:57:1 [INFO] [stdout] | [INFO] [stdout] 57 | / impl Default for ReputationFactors { [INFO] [stdout] 58 | | fn default() -> Self { [INFO] [stdout] 59 | | Self { [INFO] [stdout] 60 | | account_age_days: 0, [INFO] [stdout] ... | [INFO] [stdout] 73 | | } [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] 32 + #[derive(Default)] [INFO] [stdout] 33 | pub struct ReputationFactors { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking sg-evasion v0.1.0 (/opt/rustwide/workdir/crates/sg-evasion) [INFO] [stdout] warning: this `if let` can be collapsed into the outer `match` [INFO] [stdout] --> crates/sg-fingerprint/src/extractor.rs:161:21 [INFO] [stdout] | [INFO] [stdout] 161 | / if let sg_events::NetworkEvent::DataTransfer { [INFO] [stdout] 162 | | bytes_transferred, .. [INFO] [stdout] 163 | | } = net [INFO] [stdout] ... | [INFO] [stdout] 166 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> crates/sg-fingerprint/src/extractor.rs:160:50 [INFO] [stdout] | [INFO] [stdout] 160 | sg_events::EventPayload::Network(net) => { [INFO] [stdout] | ^^^ replace this binding [INFO] [stdout] 161 | if let sg_events::NetworkEvent::DataTransfer { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 162 | | bytes_transferred, .. [INFO] [stdout] 163 | | } = net [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 `if let` can be collapsed into the outer `match` [INFO] [stdout] --> crates/sg-fingerprint/src/extractor.rs:169:21 [INFO] [stdout] | [INFO] [stdout] 169 | / if let sg_events::SyscallEvent::FileOpen { path, .. } = syscall { [INFO] [stdout] 170 | | files_seen.insert(path.to_string_lossy().to_string()); [INFO] [stdout] 171 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> crates/sg-fingerprint/src/extractor.rs:168:50 [INFO] [stdout] | [INFO] [stdout] 168 | sg_events::EventPayload::Syscall(syscall) => { [INFO] [stdout] | ^^^^^^^ replace this binding [INFO] [stdout] 169 | if let sg_events::SyscallEvent::FileOpen { path, .. } = syscall { [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] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> crates/sg-semantic/src/context_analyzer.rs:104:9 [INFO] [stdout] | [INFO] [stdout] 104 | / (self.input_source == InputSource::Network [INFO] [stdout] 105 | | && self.output_destination == OutputDestination::Exec) [INFO] [stdout] 106 | | || (self.input_source == InputSource::Network [INFO] [stdout] 107 | | && self.output_destination == OutputDestination::Network) [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] 104 - (self.input_source == InputSource::Network [INFO] [stdout] 105 - && self.output_destination == OutputDestination::Exec) [INFO] [stdout] 106 - || (self.input_source == InputSource::Network [INFO] [stdout] 107 - && self.output_destination == OutputDestination::Network) [INFO] [stdout] 104 + !(self.input_source != InputSource::Network || self.output_destination != OutputDestination::Exec && self.output_destination != OutputDestination::Network) [INFO] [stdout] | [INFO] [stdout] 104 - (self.input_source == InputSource::Network [INFO] [stdout] 105 - && self.output_destination == OutputDestination::Exec) [INFO] [stdout] 106 - || (self.input_source == InputSource::Network [INFO] [stdout] 107 - && self.output_destination == OutputDestination::Network) [INFO] [stdout] 104 + (self.output_destination == OutputDestination::Network || self.output_destination == OutputDestination::Exec) && self.input_source == InputSource::Network [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> crates/sg-fingerprint/src/matcher.rs:297:17 [INFO] [stdout] | [INFO] [stdout] 297 | assert!(matches.len() >= 1); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!matches.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] [stderr] Checking sg-network-dpi v0.1.0 (/opt/rustwide/workdir/crates/sg-network-dpi) [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> crates/sg-semantic/src/context_analyzer.rs:104:9 [INFO] [stdout] | [INFO] [stdout] 104 | / (self.input_source == InputSource::Network [INFO] [stdout] 105 | | && self.output_destination == OutputDestination::Exec) [INFO] [stdout] 106 | | || (self.input_source == InputSource::Network [INFO] [stdout] 107 | | && self.output_destination == OutputDestination::Network) [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] 104 - (self.input_source == InputSource::Network [INFO] [stdout] 105 - && self.output_destination == OutputDestination::Exec) [INFO] [stdout] 106 - || (self.input_source == InputSource::Network [INFO] [stdout] 107 - && self.output_destination == OutputDestination::Network) [INFO] [stdout] 104 + !(self.input_source != InputSource::Network || self.output_destination != OutputDestination::Exec && self.output_destination != OutputDestination::Network) [INFO] [stdout] | [INFO] [stdout] 104 - (self.input_source == InputSource::Network [INFO] [stdout] 105 - && self.output_destination == OutputDestination::Exec) [INFO] [stdout] 106 - || (self.input_source == InputSource::Network [INFO] [stdout] 107 - && self.output_destination == OutputDestination::Network) [INFO] [stdout] 104 + (self.output_destination == OutputDestination::Network || self.output_destination == OutputDestination::Exec) && self.input_source == InputSource::Network [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> crates/sg-evasion/src/technique_fingerprints.rs:169:29 [INFO] [stdout] | [INFO] [stdout] 169 | let arg_match = args.map_or(false, |a| { [INFO] [stdout] | _____________________________^ [INFO] [stdout] 170 | | let lower_args = a.to_lowercase(); [INFO] [stdout] 171 | | fp.arg_patterns.iter().any(|p| p.is_match(&lower_args)) [INFO] [stdout] 172 | | }); [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 169 - let arg_match = args.map_or(false, |a| { [INFO] [stdout] 169 + let arg_match = args.is_some_and(|a| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking sg-consent v0.1.0 (/opt/rustwide/workdir/crates/sg-consent) [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> crates/sg-evasion/src/technique_fingerprints.rs:169:29 [INFO] [stdout] | [INFO] [stdout] 169 | let arg_match = args.map_or(false, |a| { [INFO] [stdout] | _____________________________^ [INFO] [stdout] 170 | | let lower_args = a.to_lowercase(); [INFO] [stdout] 171 | | fp.arg_patterns.iter().any(|p| p.is_match(&lower_args)) [INFO] [stdout] 172 | | }); [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 169 - let arg_match = args.map_or(false, |a| { [INFO] [stdout] 169 + let arg_match = args.is_some_and(|a| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> crates/sg-network-dpi/src/credential_scanner.rs:118:12 [INFO] [stdout] | [INFO] [stdout] 118 | if content_type.map_or(false, |ct| ct.contains("json")) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 118 - if content_type.map_or(false, |ct| ct.contains("json")) { [INFO] [stdout] 118 + if content_type.is_some_and(|ct| ct.contains("json")) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> crates/sg-network-dpi/src/http_body_inspector.rs:113:12 [INFO] [stdout] | [INFO] [stdout] 113 | if content_type.map_or(false, |ct| ct.contains("json")) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 113 - if content_type.map_or(false, |ct| ct.contains("json")) { [INFO] [stdout] 113 + if content_type.is_some_and(|ct| ct.contains("json")) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> crates/sg-network-dpi/src/credential_scanner.rs:118:12 [INFO] [stdout] | [INFO] [stdout] 118 | if content_type.map_or(false, |ct| ct.contains("json")) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 118 - if content_type.map_or(false, |ct| ct.contains("json")) { [INFO] [stdout] 118 + if content_type.is_some_and(|ct| ct.contains("json")) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> crates/sg-network-dpi/src/http_body_inspector.rs:113:12 [INFO] [stdout] | [INFO] [stdout] 113 | if content_type.map_or(false, |ct| ct.contains("json")) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 113 - if content_type.map_or(false, |ct| ct.contains("json")) { [INFO] [stdout] 113 + if content_type.is_some_and(|ct| ct.contains("json")) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> crates/sg-threat-intel/src/indicators.rs:224:9 [INFO] [stdout] | [INFO] [stdout] 224 | / if let Some(entry) = self.lookup(IocType::IpAddress, ip) { [INFO] [stdout] 225 | | Some(IocMatch { [INFO] [stdout] 226 | | observed_value: ip.to_string(), [INFO] [stdout] 227 | | matched_ioc: entry.clone(), [INFO] [stdout] ... | [INFO] [stdout] 232 | | None [INFO] [stdout] 233 | | } [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] 224 ~ self.lookup(IocType::IpAddress, ip).map(|entry| IocMatch { [INFO] [stdout] 225 + observed_value: ip.to_string(), [INFO] [stdout] 226 + matched_ioc: entry.clone(), [INFO] [stdout] 227 + matched_at: Utc::now(), [INFO] [stdout] 228 + context: context.to_string(), [INFO] [stdout] 229 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> crates/sg-threat-intel/src/indicators.rs:264:9 [INFO] [stdout] | [INFO] [stdout] 264 | / if let Some(entry) = self.lookup(IocType::FileHash, hash) { [INFO] [stdout] 265 | | Some(IocMatch { [INFO] [stdout] 266 | | observed_value: hash.to_string(), [INFO] [stdout] 267 | | matched_ioc: entry.clone(), [INFO] [stdout] ... | [INFO] [stdout] 272 | | None [INFO] [stdout] 273 | | } [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] help: try [INFO] [stdout] | [INFO] [stdout] 264 ~ self.lookup(IocType::FileHash, hash).map(|entry| IocMatch { [INFO] [stdout] 265 + observed_value: hash.to_string(), [INFO] [stdout] 266 + matched_ioc: entry.clone(), [INFO] [stdout] 267 + matched_at: Utc::now(), [INFO] [stdout] 268 + context: context.to_string(), [INFO] [stdout] 269 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> crates/sg-supply-chain/src/typosquat_detector.rs:185:71 [INFO] [stdout] | [INFO] [stdout] 185 | let suspect_stripped = suspect.strip_prefix('@').and_then(|s| s.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] 185 - let suspect_stripped = suspect.strip_prefix('@').and_then(|s| s.split('/').last()); [INFO] [stdout] 185 + let suspect_stripped = suspect.strip_prefix('@').and_then(|s| s.split('/').next_back()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> crates/sg-supply-chain/src/typosquat_detector.rs:186:69 [INFO] [stdout] | [INFO] [stdout] 186 | let target_stripped = target.strip_prefix('@').and_then(|s| s.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] help: try [INFO] [stdout] | [INFO] [stdout] 186 - let target_stripped = target.strip_prefix('@').and_then(|s| s.split('/').last()); [INFO] [stdout] 186 + let target_stripped = target.strip_prefix('@').and_then(|s| s.split('/').next_back()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `match` [INFO] [stdout] --> crates/sg-taint/src/lazy_taint.rs:175:17 [INFO] [stdout] | [INFO] [stdout] 175 | / if let Some(p) = path { [INFO] [stdout] 176 | | let path_str = p.to_string_lossy(); [INFO] [stdout] 177 | | path_str.contains(".ssh/id_") [INFO] [stdout] 178 | | || path_str.contains(".aws/credentials") [INFO] [stdout] ... | [INFO] [stdout] 182 | | false [INFO] [stdout] 183 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> crates/sg-taint/src/lazy_taint.rs:174:60 [INFO] [stdout] | [INFO] [stdout] 174 | EventPayload::Syscall(SyscallEvent::FileRead { path, .. }) => { [INFO] [stdout] | ^^^^ replace this binding [INFO] [stdout] 175 | if let Some(p) = path { [INFO] [stdout] | ^^^^^^^ with this pattern, prefixed by `path: ` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> crates/sg-taint/src/propagation.rs:34:20 [INFO] [stdout] | [INFO] [stdout] 34 | pub detect_fn: Box bool + Send + Sync>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's values [INFO] [stdout] --> crates/sg-taint/src/propagation.rs:208:24 [INFO] [stdout] | [INFO] [stdout] 208 | for (_, tv) in &self.tainted_values { [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] 208 - for (_, tv) in &self.tainted_values { [INFO] [stdout] 208 + for tv in self.tainted_values.values() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's values [INFO] [stdout] --> crates/sg-taint/src/propagation.rs:247:28 [INFO] [stdout] | [INFO] [stdout] 247 | for (_, tv) in &self.tainted_values { [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] 247 - for (_, tv) in &self.tainted_values { [INFO] [stdout] 247 + for tv in self.tainted_values.values() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> crates/sg-threat-intel/src/reputation.rs:57:1 [INFO] [stdout] | [INFO] [stdout] 57 | / impl Default for ReputationFactors { [INFO] [stdout] 58 | | fn default() -> Self { [INFO] [stdout] 59 | | Self { [INFO] [stdout] 60 | | account_age_days: 0, [INFO] [stdout] ... | [INFO] [stdout] 73 | | } [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] 32 + #[derive(Default)] [INFO] [stdout] 33 | pub struct ReputationFactors { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a suffix manually [INFO] [stdout] --> crates/sg-taint/src/transform_chain.rs:358:36 [INFO] [stdout] | [INFO] [stdout] 358 | let before_colon = before_trimmed[..before_trimmed.len() - 1].trim_end(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the suffix was tested here [INFO] [stdout] --> crates/sg-taint/src/transform_chain.rs:357:13 [INFO] [stdout] | [INFO] [stdout] 357 | if before_trimmed.ends_with(':') { [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_suffix` method [INFO] [stdout] | [INFO] [stdout] 357 ~ if let Some() = before_trimmed.strip_suffix(':') { [INFO] [stdout] 358 ~ let before_colon = .trim_end(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> crates/sg-taint/src/transform_chain.rs:383:9 [INFO] [stdout] | [INFO] [stdout] 383 | / if let Some(start) = source.find(target) { [INFO] [stdout] 384 | | Some(Transform::Substring { [INFO] [stdout] 385 | | start, [INFO] [stdout] 386 | | end: start + target.len(), [INFO] [stdout] ... | [INFO] [stdout] 389 | | None [INFO] [stdout] 390 | | } [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] 383 ~ source.find(target).map(|start| Transform::Substring { [INFO] [stdout] 384 + start, [INFO] [stdout] 385 + end: start + target.len(), [INFO] [stdout] 386 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> crates/sg-taint/src/transform_chain.rs:406:44 [INFO] [stdout] | [INFO] [stdout] 406 | let mut result = String::with_capacity((bytes.len() + 2) / 3 * 4); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `bytes.len().div_ceil(3)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> crates/sg-taint/src/transform_chain.rs:572:5 [INFO] [stdout] | [INFO] [stdout] 572 | / match (prev, next) { [INFO] [stdout] 573 | | (Some(Transform::Base64Encode), Transform::Base64Decode) => true, [INFO] [stdout] 574 | | (Some(Transform::Base64Decode), Transform::Base64Encode) => true, [INFO] [stdout] 575 | | (Some(Transform::UrlEncode), Transform::UrlDecode) => true, [INFO] [stdout] ... | [INFO] [stdout] 579 | | _ => false, [INFO] [stdout] 580 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 572 - match (prev, next) { [INFO] [stdout] 573 - (Some(Transform::Base64Encode), Transform::Base64Decode) => true, [INFO] [stdout] 574 - (Some(Transform::Base64Decode), Transform::Base64Encode) => true, [INFO] [stdout] 575 - (Some(Transform::UrlEncode), Transform::UrlDecode) => true, [INFO] [stdout] 576 - (Some(Transform::UrlDecode), Transform::UrlEncode) => true, [INFO] [stdout] 577 - (Some(Transform::HexEncode), Transform::HexDecode) => true, [INFO] [stdout] 578 - (Some(Transform::HexDecode), Transform::HexEncode) => true, [INFO] [stdout] 579 - _ => false, [INFO] [stdout] 580 - } [INFO] [stdout] 572 + matches!((prev, next), (Some(Transform::Base64Encode), Transform::Base64Decode) | (Some(Transform::Base64Decode), Transform::Base64Encode) | (Some(Transform::UrlEncode), Transform::UrlDecode) | (Some(Transform::UrlDecode), Transform::UrlEncode) | (Some(Transform::HexEncode), Transform::HexDecode) | (Some(Transform::HexDecode), Transform::HexEncode)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> crates/sg-dsl/src/parser.rs:178:17 [INFO] [stdout] | [INFO] [stdout] 178 | / if id.is_empty() { [INFO] [stdout] 179 | | id = child.as_str().to_string(); [INFO] [stdout] 180 | | } [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] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 177 ~ PestRule::ident [INFO] [stdout] 178 ~ if id.is_empty() => { [INFO] [stdout] 179 | id = child.as_str().to_string(); [INFO] [stdout] 180 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking sg-engine v0.1.0 (/opt/rustwide/workdir/crates/sg-engine) [INFO] [stderr] Checking sg-static v0.1.0 (/opt/rustwide/workdir/crates/sg-static) [INFO] [stderr] Checking sg-rules v0.1.0 (/opt/rustwide/workdir/crates/sg-rules) [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> crates/sg-dsl/src/parser.rs:178:17 [INFO] [stdout] | [INFO] [stdout] 178 | / if id.is_empty() { [INFO] [stdout] 179 | | id = child.as_str().to_string(); [INFO] [stdout] 180 | | } [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] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 177 ~ PestRule::ident [INFO] [stdout] 178 ~ if id.is_empty() => { [INFO] [stdout] 179 | id = child.as_str().to_string(); [INFO] [stdout] 180 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `match` [INFO] [stdout] --> crates/sg-engine/src/stage1/pattern_matcher.rs:237:21 [INFO] [stdout] | [INFO] [stdout] 237 | / if let Value::String(s) = value { [INFO] [stdout] 238 | | let idx = string_patterns.len(); [INFO] [stdout] 239 | | string_patterns.push(s.clone()); [INFO] [stdout] 240 | | let _ = idx; // index reserved for AC lookup [INFO] [stdout] 241 | | string_pattern_map [INFO] [stdout] 242 | | .push((rule_id.to_owned(), field_path.clone())); [INFO] [stdout] 243 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> crates/sg-engine/src/stage1/pattern_matcher.rs:235:33 [INFO] [stdout] | [INFO] [stdout] 235 | field_path, value, .. [INFO] [stdout] | ^^^^^ replace this binding [INFO] [stdout] 236 | } => { [INFO] [stdout] 237 | if let Value::String(s) = value { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ with this pattern, prefixed by `value: ` [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: use of `or_insert_with` to construct default value [INFO] [stdout] --> crates/sg-engine/src/stage2/temporal.rs:60:14 [INFO] [stdout] | [INFO] [stdout] 60 | .or_insert_with(Vec::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] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> crates/sg-static/src/clone_detector.rs:204:9 [INFO] [stdout] | [INFO] [stdout] 204 | / if normalized.len() > popular_lower.len() + 1 { [INFO] [stdout] 205 | | if normalized.starts_with(&popular_lower) || normalized.ends_with(&popular_lower) { [INFO] [stdout] 206 | | let extra: String = if normalized.starts_with(&popular_lower) { [INFO] [stdout] 207 | | normalized[popular_lower.len()..].to_string() [INFO] [stdout] ... | [INFO] [stdout] 234 | | } [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] 204 ~ if normalized.len() > popular_lower.len() + 1 [INFO] [stdout] 205 ~ && (normalized.starts_with(&popular_lower) || normalized.ends_with(&popular_lower)) { [INFO] [stdout] 206 | let extra: String = if normalized.starts_with(&popular_lower) { [INFO] [stdout] ... [INFO] [stdout] 232 | } [INFO] [stdout] 233 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> crates/sg-static/src/entropy_scanner.rs:98:49 [INFO] [stdout] | [INFO] [stdout] 98 | let severity = if layers.len() >= 2 { [INFO] [stdout] | _________________________________________________^ [INFO] [stdout] 99 | | Severity::High [INFO] [stdout] 100 | | } else if entropy > 5.5 { [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> crates/sg-static/src/entropy_scanner.rs:100:37 [INFO] [stdout] | [INFO] [stdout] 100 | } else if entropy > 5.5 { [INFO] [stdout] | _____________________________________^ [INFO] [stdout] 101 | | Severity::High [INFO] [stdout] 102 | | } else { [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking sg-response v0.1.0 (/opt/rustwide/workdir/crates/sg-response) [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> crates/sg-engine/tests/pipeline_test.rs:365:13 [INFO] [stdout] | [INFO] [stdout] 365 | assert!(result2.stage1_matches.len() >= 1); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!result2.stage1_matches.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> crates/sg-static/src/clone_detector.rs:204:9 [INFO] [stdout] | [INFO] [stdout] 204 | / if normalized.len() > popular_lower.len() + 1 { [INFO] [stdout] 205 | | if normalized.starts_with(&popular_lower) || normalized.ends_with(&popular_lower) { [INFO] [stdout] 206 | | let extra: String = if normalized.starts_with(&popular_lower) { [INFO] [stdout] 207 | | normalized[popular_lower.len()..].to_string() [INFO] [stdout] ... | [INFO] [stdout] 234 | | } [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] 204 ~ if normalized.len() > popular_lower.len() + 1 [INFO] [stdout] 205 ~ && (normalized.starts_with(&popular_lower) || normalized.ends_with(&popular_lower)) { [INFO] [stdout] 206 | let extra: String = if normalized.starts_with(&popular_lower) { [INFO] [stdout] ... [INFO] [stdout] 232 | } [INFO] [stdout] 233 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `match` [INFO] [stdout] --> crates/sg-engine/src/stage1/pattern_matcher.rs:237:21 [INFO] [stdout] | [INFO] [stdout] 237 | / if let Value::String(s) = value { [INFO] [stdout] 238 | | let idx = string_patterns.len(); [INFO] [stdout] 239 | | string_patterns.push(s.clone()); [INFO] [stdout] 240 | | let _ = idx; // index reserved for AC lookup [INFO] [stdout] 241 | | string_pattern_map [INFO] [stdout] 242 | | .push((rule_id.to_owned(), field_path.clone())); [INFO] [stdout] 243 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> crates/sg-engine/src/stage1/pattern_matcher.rs:235:33 [INFO] [stdout] | [INFO] [stdout] 235 | field_path, value, .. [INFO] [stdout] | ^^^^^ replace this binding [INFO] [stdout] 236 | } => { [INFO] [stdout] 237 | if let Value::String(s) = value { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ with this pattern, prefixed by `value: ` [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: useless use of `format!` [INFO] [stdout] --> crates/sg-static/src/unicode_analyzer.rs:520:23 [INFO] [stdout] | [INFO] [stdout] 520 | let content = format!("var x = \u{202E}access_denied\u{202C};"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"var x = \u{202E}access_denied\u{202C};".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: useless use of `format!` [INFO] [stdout] --> crates/sg-static/src/unicode_analyzer.rs:530:23 [INFO] [stdout] | [INFO] [stdout] 530 | let content = format!("const admin = \u{202E}false\u{202C};"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"const admin = \u{202E}false\u{202C};".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] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/sg-static/src/unicode_analyzer.rs:538:23 [INFO] [stdout] | [INFO] [stdout] 538 | let content = format!("pass\u{200B}word\u{200B} = 'secret'"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"pass\u{200B}word\u{200B} = 'secret'".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] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/sg-static/src/unicode_analyzer.rs:548:23 [INFO] [stdout] | [INFO] [stdout] 548 | let content = format!("\u{FEFF}console.log('hello');"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"\u{FEFF}console.log('hello');".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] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/sg-static/src/unicode_analyzer.rs:559:23 [INFO] [stdout] | [INFO] [stdout] 559 | let content = format!("normal text\u{E0001}\u{E0065}\u{E006E}more text"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"normal text\u{E0001}\u{E0065}\u{E006E}more text".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] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> crates/sg-static/src/entropy_scanner.rs:98:49 [INFO] [stdout] | [INFO] [stdout] 98 | let severity = if layers.len() >= 2 { [INFO] [stdout] | _________________________________________________^ [INFO] [stdout] 99 | | Severity::High [INFO] [stdout] 100 | | } else if entropy > 5.5 { [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> crates/sg-static/src/entropy_scanner.rs:100:37 [INFO] [stdout] | [INFO] [stdout] 100 | } else if entropy > 5.5 { [INFO] [stdout] | _____________________________________^ [INFO] [stdout] 101 | | Severity::High [INFO] [stdout] 102 | | } else { [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `clone` can be replaced with `std::slice::from_ref` [INFO] [stdout] --> crates/sg-engine/src/stage2/sequence_tracker.rs:444:54 [INFO] [stdout] | [INFO] [stdout] 444 | let results = tracker.process_event(&event1, &[nfa.clone()], &matches1); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `std::slice::from_ref(&nfa)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cloned_ref_to_slice_refs [INFO] [stdout] = note: `#[warn(clippy::cloned_ref_to_slice_refs)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `clone` can be replaced with `std::slice::from_ref` [INFO] [stdout] --> crates/sg-engine/src/stage2/sequence_tracker.rs:476:42 [INFO] [stdout] | [INFO] [stdout] 476 | tracker.process_event(&event_a1, &[nfa.clone()], &matches_a1); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `std::slice::from_ref(&nfa)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cloned_ref_to_slice_refs [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `clone` can be replaced with `std::slice::from_ref` [INFO] [stdout] --> crates/sg-engine/src/stage2/sequence_tracker.rs:481:42 [INFO] [stdout] | [INFO] [stdout] 481 | tracker.process_event(&event_b1, &[nfa.clone()], &matches_b1); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `std::slice::from_ref(&nfa)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cloned_ref_to_slice_refs [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `clone` can be replaced with `std::slice::from_ref` [INFO] [stdout] --> crates/sg-engine/src/stage2/sequence_tracker.rs:488:56 [INFO] [stdout] | [INFO] [stdout] 488 | let results = tracker.process_event(&event_a2, &[nfa.clone()], &matches_a2); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `std::slice::from_ref(&nfa)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cloned_ref_to_slice_refs [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `clone` can be replaced with `std::slice::from_ref` [INFO] [stdout] --> crates/sg-engine/src/stage2/sequence_tracker.rs:513:57 [INFO] [stdout] | [INFO] [stdout] 513 | let results = tracker.process_event(&event, &[nfa.clone()], &matches); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `std::slice::from_ref(&nfa)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cloned_ref_to_slice_refs [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `clone` can be replaced with `std::slice::from_ref` [INFO] [stdout] --> crates/sg-engine/src/stage2/sequence_tracker.rs:532:43 [INFO] [stdout] | [INFO] [stdout] 532 | tracker.process_event(&event, &[nfa.clone()], &matches); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `std::slice::from_ref(&nfa)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cloned_ref_to_slice_refs [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `clone` can be replaced with `std::slice::from_ref` [INFO] [stdout] --> crates/sg-engine/src/stage2/sequence_tracker.rs:581:40 [INFO] [stdout] | [INFO] [stdout] 581 | tracker.process_event(&event1, &[nfa.clone()], &matches1); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `std::slice::from_ref(&nfa)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cloned_ref_to_slice_refs [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> crates/sg-engine/src/stage2/temporal.rs:60:14 [INFO] [stdout] | [INFO] [stdout] 60 | .or_insert_with(Vec::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] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking sg-cli v0.1.0 (/opt/rustwide/workdir/crates/sg-cli) [INFO] [stderr] Checking sg-daemon v0.1.0 (/opt/rustwide/workdir/crates/sg-daemon) [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/sg-cli/src/commands/report.rs:145:45 [INFO] [stdout] | [INFO] [stdout] 145 | if let Some(loaded) = repo.get_rule(&id) { [INFO] [stdout] | ^^^ help: change this to: `id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> crates/sg-cli/src/commands/report.rs:156:5 [INFO] [stdout] | [INFO] [stdout] 156 | categories.sort_by(|a, b| b.1.cmp(&a.1)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 156 - categories.sort_by(|a, b| b.1.cmp(&a.1)); [INFO] [stdout] 156 + categories.sort_by_key(|b| std::cmp::Reverse(b.1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/sg-cli/src/commands/report.rs:145:45 [INFO] [stdout] | [INFO] [stdout] 145 | if let Some(loaded) = repo.get_rule(&id) { [INFO] [stdout] | ^^^ help: change this to: `id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> crates/sg-cli/src/commands/report.rs:156:5 [INFO] [stdout] | [INFO] [stdout] 156 | categories.sort_by(|a, b| b.1.cmp(&a.1)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 156 - categories.sort_by(|a, b| b.1.cmp(&a.1)); [INFO] [stdout] 156 + categories.sort_by_key(|b| std::cmp::Reverse(b.1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 44s [INFO] running `Command { std: "docker" "inspect" "13f9f18c244ca58ac740c10f6c1c70f1c37fa05cc9e236e6064886374a3ee5c8", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "13f9f18c244ca58ac740c10f6c1c70f1c37fa05cc9e236e6064886374a3ee5c8", kill_on_drop: false }` [INFO] [stdout] 13f9f18c244ca58ac740c10f6c1c70f1c37fa05cc9e236e6064886374a3ee5c8