[INFO] cloning repository https://github.com/picopock/singbox_subscription_convert [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/picopock/singbox_subscription_convert" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fpicopock%2Fsingbox_subscription_convert", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fpicopock%2Fsingbox_subscription_convert'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 10e020f5e48f2fe0aa2fdfe466756a8afc28234c [INFO] linting picopock/singbox_subscription_convert against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fpicopock%2Fsingbox_subscription_convert" "/workspace/builds/worker-0-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-0-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/picopock/singbox_subscription_convert [INFO] finished tweaking git repo https://github.com/picopock/singbox_subscription_convert [INFO] tweaked toml for git repo https://github.com/picopock/singbox_subscription_convert written to /workspace/builds/worker-0-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/picopock/singbox_subscription_convert 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/picopock/singbox_subscription_convert 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] [stderr] Updating crates.io index [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded wiremock v0.6.5 [INFO] [stderr] Downloaded dirs v6.0.0 [INFO] [stderr] Downloaded itoa v1.0.16 [INFO] [stderr] Downloaded libredox v0.1.11 [INFO] [stderr] Downloaded cached_proc_macro v0.25.0 [INFO] [stderr] Downloaded cached_proc_macro_types v0.1.1 [INFO] [stderr] Downloaded json5 v0.4.1 [INFO] [stderr] Downloaded pest_generator v2.8.4 [INFO] [stderr] Downloaded erased-serde v0.4.9 [INFO] [stderr] Downloaded pest_meta v2.8.4 [INFO] [stderr] Downloaded pest_derive v2.8.4 [INFO] [stderr] Downloaded cached v0.56.0 [INFO] [stderr] Downloaded yaml-rust2 v0.10.4 [INFO] [stderr] Downloaded cc v1.2.51 [INFO] [stderr] Downloaded config v0.15.19 [INFO] [stderr] Downloaded pest v2.8.4 [INFO] [stderr] Downloaded ron v0.12.0 [INFO] [stderr] Downloaded serde_json v1.0.147 [INFO] [stderr] Downloaded toml v0.9.10+spec-1.1.0 [INFO] [stderr] Downloaded zmij v0.1.9 [INFO] [stderr] Downloaded serde-untagged v0.1.9 [INFO] [stderr] Downloaded redox_users v0.5.2 [INFO] [stderr] Downloaded arraydeque v0.5.1 [INFO] [stderr] Downloaded rustls-pki-types v1.13.2 [INFO] [stderr] Downloaded find-msvc-tools v0.1.6 [INFO] [stderr] Downloaded deadpool v0.12.3 [INFO] [stderr] Downloaded rust-ini v0.21.3 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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] f9c67f0987cc79787b07dc4fa7e93777a01d7900bd9e8425f8ca17979f5a7a4f [INFO] running `Command { std: "docker" "start" "-a" "f9c67f0987cc79787b07dc4fa7e93777a01d7900bd9e8425f8ca17979f5a7a4f", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "f9c67f0987cc79787b07dc4fa7e93777a01d7900bd9e8425f8ca17979f5a7a4f", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "f9c67f0987cc79787b07dc4fa7e93777a01d7900bd9e8425f8ca17979f5a7a4f", kill_on_drop: false }` [INFO] [stdout] f9c67f0987cc79787b07dc4fa7e93777a01d7900bd9e8425f8ca17979f5a7a4f [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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] b411acf517cd6d84e253de374c33554c3d1a3f9278d6c6171dd97b7bcd42d37e [INFO] running `Command { std: "docker" "start" "-a" "b411acf517cd6d84e253de374c33554c3d1a3f9278d6c6171dd97b7bcd42d37e", kill_on_drop: false }` [INFO] [stderr] Compiling syn v2.0.111 [INFO] [stderr] Compiling libc v0.2.178 [INFO] [stderr] Compiling serde_core v1.0.228 [INFO] [stderr] Checking itoa v1.0.16 [INFO] [stderr] Compiling find-msvc-tools v0.1.6 [INFO] [stderr] Compiling serde v1.0.228 [INFO] [stderr] Checking futures-io v0.3.31 [INFO] [stderr] Checking tracing-core v0.1.36 [INFO] [stderr] Compiling tiny-keccak v2.0.2 [INFO] [stderr] Compiling icu_properties_data v2.1.2 [INFO] [stderr] Compiling crunchy v0.2.4 [INFO] [stderr] Checking rustls-pki-types v1.13.2 [INFO] [stderr] Compiling serde_json v1.0.147 [INFO] [stderr] Compiling typeid v1.0.3 [INFO] [stderr] Compiling once_cell v1.21.3 [INFO] [stderr] Compiling pest v2.8.4 [INFO] [stderr] Checking zmij v0.1.9 [INFO] [stderr] Compiling rustls v0.23.35 [INFO] [stderr] Checking regex-automata v0.4.13 [INFO] [stderr] Compiling cc v1.2.51 [INFO] [stderr] Compiling erased-serde v0.4.9 [INFO] [stderr] Compiling ahash v0.8.12 [INFO] [stderr] Checking http v1.4.0 [INFO] [stderr] Compiling num-traits v0.2.19 [INFO] [stderr] Checking winnow v0.7.14 [INFO] [stderr] Checking ryu v1.0.21 [INFO] [stderr] Checking hashbrown v0.14.5 [INFO] [stderr] Checking ucd-trie v0.1.7 [INFO] [stderr] Checking arraydeque v0.5.1 [INFO] [stderr] Checking option-ext v0.2.0 [INFO] [stderr] Checking webpki-roots v1.0.4 [INFO] [stderr] Checking rustls-native-certs v0.8.2 [INFO] [stderr] Checking yaml-rust2 v0.10.4 [INFO] [stderr] Checking convert_case v0.6.0 [INFO] [stderr] Checking tracing-log v0.2.0 [INFO] [stderr] Checking thread_local v1.1.9 [INFO] [stderr] Compiling rustix v1.1.3 [INFO] [stderr] Checking unsafe-libyaml v0.2.11 [INFO] [stderr] Checking pathdiff v0.2.3 [INFO] [stderr] Checking cached_proc_macro_types v0.1.1 [INFO] [stderr] Checking nu-ansi-term v0.50.3 [INFO] [stderr] Checking deadpool-runtime v0.1.4 [INFO] [stderr] Checking errno v0.3.14 [INFO] [stderr] Checking parking_lot_core v0.9.12 [INFO] [stderr] Checking socket2 v0.6.1 [INFO] [stderr] Checking mio v1.1.1 [INFO] [stderr] Checking getrandom v0.2.16 [INFO] [stderr] Checking dirs-sys v0.5.0 [INFO] [stderr] Checking num_cpus v1.17.0 [INFO] [stderr] Checking getrandom v0.3.4 [INFO] [stderr] Checking dirs v6.0.0 [INFO] [stderr] Checking signal-hook-registry v1.4.8 [INFO] [stderr] Checking parking_lot v0.12.5 [INFO] [stderr] Checking http-body v1.0.1 [INFO] [stderr] Checking http-body-util v0.1.3 [INFO] [stderr] Compiling pest_meta v2.8.4 [INFO] [stderr] Compiling const-random-macro v0.1.16 [INFO] [stderr] Compiling ring v0.17.14 [INFO] [stderr] Checking const-random v0.1.18 [INFO] [stderr] Checking dlv-list v0.5.2 [INFO] [stderr] Checking toml_parser v1.0.6+spec-1.1.0 [INFO] [stderr] Checking ordered-multimap v0.7.3 [INFO] [stderr] Checking rust-ini v0.21.3 [INFO] [stderr] Checking regex v1.12.2 [INFO] [stderr] Checking matchers v0.2.0 [INFO] [stderr] Checking indexmap v2.12.1 [INFO] [stderr] Checking bitflags v2.10.0 [INFO] [stderr] Checking serde_spanned v1.0.4 [INFO] [stderr] Checking toml_datetime v0.7.5+spec-1.1.0 [INFO] [stderr] Checking toml v0.9.10+spec-1.1.0 [INFO] [stderr] Checking serde-untagged v0.1.9 [INFO] [stderr] Compiling synstructure v0.13.2 [INFO] [stderr] Compiling darling_core v0.21.3 [INFO] [stderr] Compiling darling_core v0.20.11 [INFO] [stderr] Compiling pest_generator v2.8.4 [INFO] [stderr] Compiling tokio-macros v2.6.0 [INFO] [stderr] Compiling zerovec-derive v0.11.2 [INFO] [stderr] Compiling displaydoc v0.2.5 [INFO] [stderr] Compiling serde_derive v1.0.228 [INFO] [stderr] Compiling futures-macro v0.3.31 [INFO] [stderr] Compiling tracing-attributes v0.1.31 [INFO] [stderr] Compiling thiserror-impl v2.0.17 [INFO] [stderr] Compiling async-trait v0.1.89 [INFO] [stderr] Compiling clap_derive v4.5.49 [INFO] [stderr] Compiling async-stream-impl v0.3.6 [INFO] [stderr] Checking tempfile v3.24.0 [INFO] [stderr] Compiling zerofrom-derive v0.1.6 [INFO] [stderr] Compiling yoke-derive v0.8.1 [INFO] [stderr] Checking async-stream v0.3.6 [INFO] [stderr] Checking tokio v1.48.0 [INFO] [stderr] Checking rustls-webpki v0.103.8 [INFO] [stderr] Compiling pest_derive v2.8.4 [INFO] [stderr] Checking futures-util v0.3.31 [INFO] [stderr] Checking thiserror v2.0.17 [INFO] [stderr] Checking tracing v0.1.44 [INFO] [stderr] Checking tracing-subscriber v0.3.22 [INFO] [stderr] Checking zerofrom v0.1.6 [INFO] [stderr] Checking yoke v0.8.1 [INFO] [stderr] Checking zerovec v0.11.5 [INFO] [stderr] Checking zerotrie v0.2.3 [INFO] [stderr] Compiling darling_macro v0.20.11 [INFO] [stderr] Checking clap v4.5.53 [INFO] [stderr] Compiling darling v0.20.11 [INFO] [stderr] Checking tinystr v0.8.2 [INFO] [stderr] Checking potential_utf v0.1.4 [INFO] [stderr] Compiling cached_proc_macro v0.25.0 [INFO] [stderr] Checking icu_collections v2.1.1 [INFO] [stderr] Checking icu_locale_core v2.1.1 [INFO] [stderr] Compiling darling_macro v0.21.3 [INFO] [stderr] Checking ron v0.12.0 [INFO] [stderr] Checking serde_urlencoded v0.7.1 [INFO] [stderr] Checking json5 v0.4.1 [INFO] [stderr] Checking chrono v0.4.42 [INFO] [stderr] Checking serde_yaml v0.9.34+deprecated [INFO] [stderr] Checking assert-json-diff v2.0.2 [INFO] [stderr] Compiling darling v0.21.3 [INFO] [stderr] Compiling serde_with_macros v3.16.1 [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_with v3.16.1 [INFO] [stderr] Checking config v0.15.19 [INFO] [stderr] Checking futures-executor v0.3.31 [INFO] [stderr] Checking idna_adapter v1.2.1 [INFO] [stderr] Checking futures v0.3.31 [INFO] [stderr] Checking idna v1.1.0 [INFO] [stderr] Checking url v2.5.7 [INFO] [stderr] Checking tokio-util v0.7.17 [INFO] [stderr] Checking tokio-rustls v0.26.4 [INFO] [stderr] Checking tower v0.5.2 [INFO] [stderr] Checking cached v0.56.0 [INFO] [stderr] Checking tokio-stream v0.1.17 [INFO] [stderr] Checking deadpool v0.12.3 [INFO] [stderr] Checking tokio-test v0.4.4 [INFO] [stderr] Checking h2 v0.4.12 [INFO] [stderr] Checking tower-http v0.6.8 [INFO] [stderr] Checking hyper v1.8.1 [INFO] [stderr] Checking hyper-util v0.1.19 [INFO] [stderr] Checking hyper-rustls v0.27.7 [INFO] [stderr] Checking wiremock v0.6.5 [INFO] [stderr] Checking reqwest v0.12.28 [INFO] [stderr] Checking proxy-convert v2.0.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str` [INFO] [stdout] --> src/commands/convert.rs:20:5 [INFO] [stdout] | [INFO] [stdout] 20 | / pub fn from_str(s: &str) -> Option { [INFO] [stdout] 21 | | match s.to_lowercase().as_str() { [INFO] [stdout] 22 | | "sing-box" | "singbox" => Some(OutputProtocol::SingBox), [INFO] [stdout] 23 | | "clash" => Some(OutputProtocol::Clash), [INFO] [stdout] ... | [INFO] [stdout] 27 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] = note: `#[warn(clippy::should_implement_trait)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/commands/convert.rs:86:64 [INFO] [stdout] | [INFO] [stdout] 86 | std::fs::read_to_string(template_path).map_err(|e| ConvertError::IoError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `ConvertError::IoError` [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/commands/convert.rs:100:57 [INFO] [stdout] | [INFO] [stdout] 100 | std::fs::create_dir_all(parent).map_err(|e| ConvertError::IoError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `ConvertError::IoError` [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: redundant closure [INFO] [stdout] --> src/commands/convert.rs:103:64 [INFO] [stdout] | [INFO] [stdout] 103 | std::fs::write(&output_path, formatted_result).map_err(|e| ConvertError::IoError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `ConvertError::IoError` [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: redundant closure [INFO] [stdout] --> src/commands/convert.rs:211:59 [INFO] [stdout] | [INFO] [stdout] 211 | serde_json::from_str(content).map_err(|e| ConvertError::JsonParseError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `ConvertError::JsonParseError` [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: redundant closure [INFO] [stdout] --> src/commands/convert.rs:213:30 [INFO] [stdout] | [INFO] [stdout] 213 | .map_err(|e| ConvertError::JsonParseError(e))?) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `ConvertError::JsonParseError` [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: redundant closure [INFO] [stdout] --> src/commands/convert.rs:218:59 [INFO] [stdout] | [INFO] [stdout] 218 | serde_json::from_str(content).map_err(|e| ConvertError::JsonParseError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `ConvertError::JsonParseError` [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: redundant closure [INFO] [stdout] --> src/commands/template.rs:62:61 [INFO] [stdout] | [INFO] [stdout] 62 | std::fs::write(&output_path, &template_content).map_err(|e| ConvertError::IoError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `ConvertError::IoError` [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: redundant closure [INFO] [stdout] --> src/commands/validate.rs:48:64 [INFO] [stdout] | [INFO] [stdout] 48 | let content = std::fs::read_to_string(&*file_path).map_err(|e| ConvertError::IoError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `ConvertError::IoError` [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: redundant closure [INFO] [stdout] --> src/commands/validate.rs:66:47 [INFO] [stdout] | [INFO] [stdout] 66 | serde_json::from_str(content).map_err(|e| ConvertError::JsonParseError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `ConvertError::JsonParseError` [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: redundant closure [INFO] [stdout] --> src/commands/validate.rs:100:47 [INFO] [stdout] | [INFO] [stdout] 100 | serde_json::from_str(content).map_err(|e| ConvertError::JsonParseError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `ConvertError::JsonParseError` [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 assertion is always `true` [INFO] [stdout] --> src/commands/version.rs:17:9 [INFO] [stdout] | [INFO] [stdout] 17 | assert!(true); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove the assertion [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants [INFO] [stdout] = note: `#[warn(clippy::assertions_on_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/core/config.rs:267:9 [INFO] [stdout] | [INFO] [stdout] 267 | / config.sources = Some(vec![ [INFO] [stdout] 268 | | "https://example.com/clash.yaml?type=clash&name=source1".to_string(), [INFO] [stdout] 269 | | "https://example.com/singbox.json?type=singbox&name=source2".to_string(), [INFO] [stdout] 270 | | ]); [INFO] [stdout] | |___________^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `core::config::AppConfig { sources: Some(vec![ [INFO] [stdout] "https://example.com/clash.yaml?type=clash&name=source1".to_string(), [INFO] [stdout] "https://example.com/singbox.json?type=singbox&name=source2".to_string(), [INFO] [stdout] ]), ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/core/config.rs:266:9 [INFO] [stdout] | [INFO] [stdout] 266 | let mut config = AppConfig::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: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str` [INFO] [stdout] --> src/core/source.rs:30:5 [INFO] [stdout] | [INFO] [stdout] 30 | / pub fn from_str(s: &str) -> Option { [INFO] [stdout] 31 | | match s.to_lowercase().as_str() { [INFO] [stdout] 32 | | "clash" => Some(SourceProtocol::Clash), [INFO] [stdout] 33 | | "sing-box" | "singbox" => Some(SourceProtocol::SingBox), [INFO] [stdout] ... | [INFO] [stdout] 37 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str` [INFO] [stdout] --> src/commands/convert.rs:20:5 [INFO] [stdout] | [INFO] [stdout] 20 | / pub fn from_str(s: &str) -> Option { [INFO] [stdout] 21 | | match s.to_lowercase().as_str() { [INFO] [stdout] 22 | | "sing-box" | "singbox" => Some(OutputProtocol::SingBox), [INFO] [stdout] 23 | | "clash" => Some(OutputProtocol::Clash), [INFO] [stdout] ... | [INFO] [stdout] 27 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] = note: `#[warn(clippy::should_implement_trait)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/commands/convert.rs:86:64 [INFO] [stdout] | [INFO] [stdout] 86 | std::fs::read_to_string(template_path).map_err(|e| ConvertError::IoError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `ConvertError::IoError` [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/commands/convert.rs:100:57 [INFO] [stdout] | [INFO] [stdout] 100 | std::fs::create_dir_all(parent).map_err(|e| ConvertError::IoError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `ConvertError::IoError` [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: redundant closure [INFO] [stdout] --> src/commands/convert.rs:103:64 [INFO] [stdout] | [INFO] [stdout] 103 | std::fs::write(&output_path, formatted_result).map_err(|e| ConvertError::IoError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `ConvertError::IoError` [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: redundant closure [INFO] [stdout] --> src/commands/convert.rs:211:59 [INFO] [stdout] | [INFO] [stdout] 211 | serde_json::from_str(content).map_err(|e| ConvertError::JsonParseError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `ConvertError::JsonParseError` [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: redundant closure [INFO] [stdout] --> src/commands/convert.rs:213:30 [INFO] [stdout] | [INFO] [stdout] 213 | .map_err(|e| ConvertError::JsonParseError(e))?) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `ConvertError::JsonParseError` [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: redundant closure [INFO] [stdout] --> src/commands/convert.rs:218:59 [INFO] [stdout] | [INFO] [stdout] 218 | serde_json::from_str(content).map_err(|e| ConvertError::JsonParseError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `ConvertError::JsonParseError` [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: redundant closure [INFO] [stdout] --> src/commands/template.rs:62:61 [INFO] [stdout] | [INFO] [stdout] 62 | std::fs::write(&output_path, &template_content).map_err(|e| ConvertError::IoError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `ConvertError::IoError` [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: redundant closure [INFO] [stdout] --> src/commands/validate.rs:48:64 [INFO] [stdout] | [INFO] [stdout] 48 | let content = std::fs::read_to_string(&*file_path).map_err(|e| ConvertError::IoError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `ConvertError::IoError` [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: redundant closure [INFO] [stdout] --> src/commands/validate.rs:66:47 [INFO] [stdout] | [INFO] [stdout] 66 | serde_json::from_str(content).map_err(|e| ConvertError::JsonParseError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `ConvertError::JsonParseError` [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: redundant closure [INFO] [stdout] --> src/commands/validate.rs:100:47 [INFO] [stdout] | [INFO] [stdout] 100 | serde_json::from_str(content).map_err(|e| ConvertError::JsonParseError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `ConvertError::JsonParseError` [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: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str` [INFO] [stdout] --> src/core/source.rs:30:5 [INFO] [stdout] | [INFO] [stdout] 30 | / pub fn from_str(s: &str) -> Option { [INFO] [stdout] 31 | | match s.to_lowercase().as_str() { [INFO] [stdout] 32 | | "clash" => Some(SourceProtocol::Clash), [INFO] [stdout] 33 | | "sing-box" | "singbox" => Some(SourceProtocol::SingBox), [INFO] [stdout] ... | [INFO] [stdout] 37 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/protocols/clash/template_processor.rs:134:20 [INFO] [stdout] | [INFO] [stdout] 134 | if !(is_shadowsocks && key == "udp") && !skip_keys.contains(&key.as_str()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(skip_keys.contains(&key.as_str()) || is_shadowsocks && key == "udp")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/protocols/clash/template_processor.rs:435:17 [INFO] [stdout] | [INFO] [stdout] 435 | / if s.starts_with("{{") && s.ends_with("}}") { [INFO] [stdout] 436 | | // Parse and process interpolation [INFO] [stdout] 437 | | if let Ok(rule) = InterpolationParser::parse(s) { [INFO] [stdout] 438 | | let nodes = self.get_nodes_for_rule(&rule, sources)?; [INFO] [stdout] ... | [INFO] [stdout] 445 | | } [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] 434 ~ serde_json::Value::String(s) [INFO] [stdout] 435 ~ if s.starts_with("{{") && s.ends_with("}}") => { [INFO] [stdout] 436 | // Parse and process interpolation [INFO] [stdout] ... [INFO] [stdout] 444 | } [INFO] [stdout] 445 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/protocols/detect.rs:135:30 [INFO] [stdout] | [INFO] [stdout] 135 | if trimmed.is_empty() || trimmed.len() % 4 != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `!trimmed.len().is_multiple_of(4)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/protocols/singbox/common/base.rs:13:1 [INFO] [stdout] | [INFO] [stdout] 13 | / impl Default for Strategy { [INFO] [stdout] 14 | | fn default() -> Self { [INFO] [stdout] 15 | | Strategy::PreferIpv4 [INFO] [stdout] 16 | | } [INFO] [stdout] 17 | | } [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] 6 + #[derive(Default)] [INFO] [stdout] 7 | pub enum Strategy { [INFO] [stdout] 8 ~ #[default] [INFO] [stdout] 9 ~ PreferIpv4, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/protocols/singbox/common/base.rs:52:1 [INFO] [stdout] | [INFO] [stdout] 52 | / impl Default for Network { [INFO] [stdout] 53 | | fn default() -> Self { [INFO] [stdout] 54 | | Network::Tcp [INFO] [stdout] 55 | | } [INFO] [stdout] 56 | | } [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 Network { [INFO] [stdout] 49 ~ #[default] [INFO] [stdout] 50 ~ Tcp, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/protocols/singbox/common/base.rs:83:1 [INFO] [stdout] | [INFO] [stdout] 83 | / impl Default for Stack { [INFO] [stdout] 84 | | fn default() -> Self { [INFO] [stdout] 85 | | Stack::Mixed [INFO] [stdout] 86 | | } [INFO] [stdout] 87 | | } [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] 77 + #[derive(Default)] [INFO] [stdout] 78 | pub enum Stack { [INFO] [stdout] 79 | System, [INFO] [stdout] 80 | Gvisor, [INFO] [stdout] 81 ~ #[default] [INFO] [stdout] 82 ~ Mixed, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/protocols/singbox/common/multiplex.rs:30:1 [INFO] [stdout] | [INFO] [stdout] 30 | / impl Default for MultiplexProtocol { [INFO] [stdout] 31 | | fn default() -> Self { [INFO] [stdout] 32 | | MultiplexProtocol::H2mux [INFO] [stdout] 33 | | } [INFO] [stdout] 34 | | } [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] 24 + #[derive(Default)] [INFO] [stdout] 25 | pub enum MultiplexProtocol { [INFO] [stdout] 26 | Smux, [INFO] [stdout] 27 | Yamux, [INFO] [stdout] 28 ~ #[default] [INFO] [stdout] 29 ~ H2mux, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/protocols/clash/template_processor.rs:134:20 [INFO] [stdout] | [INFO] [stdout] 134 | if !(is_shadowsocks && key == "udp") && !skip_keys.contains(&key.as_str()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(skip_keys.contains(&key.as_str()) || is_shadowsocks && key == "udp")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/protocols/clash/template_processor.rs:435:17 [INFO] [stdout] | [INFO] [stdout] 435 | / if s.starts_with("{{") && s.ends_with("}}") { [INFO] [stdout] 436 | | // Parse and process interpolation [INFO] [stdout] 437 | | if let Ok(rule) = InterpolationParser::parse(s) { [INFO] [stdout] 438 | | let nodes = self.get_nodes_for_rule(&rule, sources)?; [INFO] [stdout] ... | [INFO] [stdout] 445 | | } [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] 434 ~ serde_json::Value::String(s) [INFO] [stdout] 435 ~ if s.starts_with("{{") && s.ends_with("}}") => { [INFO] [stdout] 436 | // Parse and process interpolation [INFO] [stdout] ... [INFO] [stdout] 444 | } [INFO] [stdout] 445 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/protocols/detect.rs:135:30 [INFO] [stdout] | [INFO] [stdout] 135 | if trimmed.is_empty() || trimmed.len() % 4 != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `!trimmed.len().is_multiple_of(4)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/protocols/singbox/common/base.rs:13:1 [INFO] [stdout] | [INFO] [stdout] 13 | / impl Default for Strategy { [INFO] [stdout] 14 | | fn default() -> Self { [INFO] [stdout] 15 | | Strategy::PreferIpv4 [INFO] [stdout] 16 | | } [INFO] [stdout] 17 | | } [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] 6 + #[derive(Default)] [INFO] [stdout] 7 | pub enum Strategy { [INFO] [stdout] 8 ~ #[default] [INFO] [stdout] 9 ~ PreferIpv4, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/protocols/singbox/common/base.rs:52:1 [INFO] [stdout] | [INFO] [stdout] 52 | / impl Default for Network { [INFO] [stdout] 53 | | fn default() -> Self { [INFO] [stdout] 54 | | Network::Tcp [INFO] [stdout] 55 | | } [INFO] [stdout] 56 | | } [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 Network { [INFO] [stdout] 49 ~ #[default] [INFO] [stdout] 50 ~ Tcp, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/protocols/singbox/common/base.rs:83:1 [INFO] [stdout] | [INFO] [stdout] 83 | / impl Default for Stack { [INFO] [stdout] 84 | | fn default() -> Self { [INFO] [stdout] 85 | | Stack::Mixed [INFO] [stdout] 86 | | } [INFO] [stdout] 87 | | } [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] 77 + #[derive(Default)] [INFO] [stdout] 78 | pub enum Stack { [INFO] [stdout] 79 | System, [INFO] [stdout] 80 | Gvisor, [INFO] [stdout] 81 ~ #[default] [INFO] [stdout] 82 ~ Mixed, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/protocols/singbox/common/multiplex.rs:30:1 [INFO] [stdout] | [INFO] [stdout] 30 | / impl Default for MultiplexProtocol { [INFO] [stdout] 31 | | fn default() -> Self { [INFO] [stdout] 32 | | MultiplexProtocol::H2mux [INFO] [stdout] 33 | | } [INFO] [stdout] 34 | | } [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] 24 + #[derive(Default)] [INFO] [stdout] 25 | pub enum MultiplexProtocol { [INFO] [stdout] 26 | Smux, [INFO] [stdout] 27 | Yamux, [INFO] [stdout] 28 ~ #[default] [INFO] [stdout] 29 ~ H2mux, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: large size difference between variants [INFO] [stdout] --> src/protocols/singbox/dns.rs:183:1 [INFO] [stdout] | [INFO] [stdout] 183 | / pub enum Rule { [INFO] [stdout] 184 | | Logical(LogicalRule), [INFO] [stdout] | | -------------------- the second-largest variant contains at least 56 bytes [INFO] [stdout] 185 | | Basic(BasicRule), [INFO] [stdout] | | ---------------- the largest variant contains at least 928 bytes [INFO] [stdout] 186 | | } [INFO] [stdout] | |_^ the entire enum is at least 928 bytes [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant [INFO] [stdout] = note: `#[warn(clippy::large_enum_variant)]` on by default [INFO] [stdout] help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum [INFO] [stdout] | [INFO] [stdout] 185 - Basic(BasicRule), [INFO] [stdout] 185 + Basic(Box), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: large size difference between variants [INFO] [stdout] --> src/protocols/singbox/dns.rs:183:1 [INFO] [stdout] | [INFO] [stdout] 183 | / pub enum Rule { [INFO] [stdout] 184 | | Logical(LogicalRule), [INFO] [stdout] | | -------------------- the second-largest variant contains at least 56 bytes [INFO] [stdout] 185 | | Basic(BasicRule), [INFO] [stdout] | | ---------------- the largest variant contains at least 928 bytes [INFO] [stdout] 186 | | } [INFO] [stdout] | |_^ the entire enum is at least 928 bytes [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant [INFO] [stdout] = note: `#[warn(clippy::large_enum_variant)]` on by default [INFO] [stdout] help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum [INFO] [stdout] | [INFO] [stdout] 185 - Basic(BasicRule), [INFO] [stdout] 185 + Basic(Box), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/protocols/singbox/log.rs:42:1 [INFO] [stdout] | [INFO] [stdout] 42 | / impl Default for LogLevel { [INFO] [stdout] 43 | | fn default() -> Self { [INFO] [stdout] 44 | | Self::Info [INFO] [stdout] 45 | | } [INFO] [stdout] 46 | | } [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] 32 + #[derive(Default)] [INFO] [stdout] 33 | pub enum LogLevel { [INFO] [stdout] 34 | Trace, [INFO] [stdout] 35 | Debug, [INFO] [stdout] 36 ~ #[default] [INFO] [stdout] 37 ~ Info, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: large size difference between variants [INFO] [stdout] --> src/protocols/singbox/route/rule.rs:11:1 [INFO] [stdout] | [INFO] [stdout] 11 | / pub enum Rule { [INFO] [stdout] 12 | | Logical(LogicalRule), [INFO] [stdout] | | -------------------- the second-largest variant contains at least 56 bytes [INFO] [stdout] 13 | | Basic(BasicRule), [INFO] [stdout] | | ---------------- the largest variant contains at least 1032 bytes [INFO] [stdout] 14 | | } [INFO] [stdout] | |_^ the entire enum is at least 1032 bytes [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant [INFO] [stdout] help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum [INFO] [stdout] | [INFO] [stdout] 13 - Basic(BasicRule), [INFO] [stdout] 13 + Basic(Box), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/protocols/singbox/log.rs:42:1 [INFO] [stdout] | [INFO] [stdout] 42 | / impl Default for LogLevel { [INFO] [stdout] 43 | | fn default() -> Self { [INFO] [stdout] 44 | | Self::Info [INFO] [stdout] 45 | | } [INFO] [stdout] 46 | | } [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] 32 + #[derive(Default)] [INFO] [stdout] 33 | pub enum LogLevel { [INFO] [stdout] 34 | Trace, [INFO] [stdout] 35 | Debug, [INFO] [stdout] 36 ~ #[default] [INFO] [stdout] 37 ~ Info, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: large size difference between variants [INFO] [stdout] --> src/protocols/singbox/route/rule_set.rs:48:1 [INFO] [stdout] | [INFO] [stdout] 48 | / pub enum HeadlessRule { [INFO] [stdout] 49 | | Logical(LogicalRule), [INFO] [stdout] | | -------------------- the second-largest variant contains at least 56 bytes [INFO] [stdout] 50 | | Basic(BasicRule), [INFO] [stdout] | | ---------------- the largest variant contains at least 656 bytes [INFO] [stdout] 51 | | } [INFO] [stdout] | |_^ the entire enum is at least 656 bytes [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant [INFO] [stdout] help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum [INFO] [stdout] | [INFO] [stdout] 50 - Basic(BasicRule), [INFO] [stdout] 50 + Basic(Box), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/protocols/singbox/template_processor.rs:567:20 [INFO] [stdout] | [INFO] [stdout] 567 | if !skip_keys.contains(&key.as_str()) && !(is_shadowsocks && key == "udp") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(skip_keys.contains(&key.as_str()) || is_shadowsocks && key == "udp")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Result::Err` [INFO] [stdout] --> src/protocols/subscription.rs:126:20 [INFO] [stdout] | [INFO] [stdout] 126 | let name = urlencoding::decode(name_encoded) [INFO] [stdout] | ____________________^ [INFO] [stdout] 127 | | .unwrap_or_else(|_| std::borrow::Cow::Borrowed(name_encoded)) [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 `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 127 - .unwrap_or_else(|_| std::borrow::Cow::Borrowed(name_encoded)) [INFO] [stdout] 127 + .unwrap_or(std::borrow::Cow::Borrowed(name_encoded)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: large size difference between variants [INFO] [stdout] --> src/protocols/singbox/route/rule.rs:11:1 [INFO] [stdout] | [INFO] [stdout] 11 | / pub enum Rule { [INFO] [stdout] 12 | | Logical(LogicalRule), [INFO] [stdout] | | -------------------- the second-largest variant contains at least 56 bytes [INFO] [stdout] 13 | | Basic(BasicRule), [INFO] [stdout] | | ---------------- the largest variant contains at least 1032 bytes [INFO] [stdout] 14 | | } [INFO] [stdout] | |_^ the entire enum is at least 1032 bytes [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant [INFO] [stdout] help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum [INFO] [stdout] | [INFO] [stdout] 13 - Basic(BasicRule), [INFO] [stdout] 13 + Basic(Box), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: large size difference between variants [INFO] [stdout] --> src/protocols/singbox/route/rule_set.rs:48:1 [INFO] [stdout] | [INFO] [stdout] 48 | / pub enum HeadlessRule { [INFO] [stdout] 49 | | Logical(LogicalRule), [INFO] [stdout] | | -------------------- the second-largest variant contains at least 56 bytes [INFO] [stdout] 50 | | Basic(BasicRule), [INFO] [stdout] | | ---------------- the largest variant contains at least 656 bytes [INFO] [stdout] 51 | | } [INFO] [stdout] | |_^ the entire enum is at least 656 bytes [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant [INFO] [stdout] help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum [INFO] [stdout] | [INFO] [stdout] 50 - Basic(BasicRule), [INFO] [stdout] 50 + Basic(Box), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/utils/source/loader.rs:189:47 [INFO] [stdout] | [INFO] [stdout] 189 | std::fs::read_to_string(path).map_err(|e| ConvertError::IoError(e)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `ConvertError::IoError` [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: large size difference between variants [INFO] [stdout] --> src/utils/source/parser.rs:10:1 [INFO] [stdout] | [INFO] [stdout] 10 | / pub enum Config { [INFO] [stdout] 11 | | Clash(clash::Config), [INFO] [stdout] 12 | | SingBox(singbox::Config), [INFO] [stdout] | | ------------------------ the largest variant contains at least 1312 bytes [INFO] [stdout] 13 | | V2Ray(v2ray::Config), [INFO] [stdout] | | -------------------- the second-largest variant contains at least 384 bytes [INFO] [stdout] ... | [INFO] [stdout] 17 | | Plain(Vec), [INFO] [stdout] 18 | | } [INFO] [stdout] | |_^ the entire enum is at least 1312 bytes [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant [INFO] [stdout] help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum [INFO] [stdout] | [INFO] [stdout] 12 - SingBox(singbox::Config), [INFO] [stdout] 12 + SingBox(Box), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `TemplateEngine` [INFO] [stdout] --> src/utils/template/template_engine.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 23 | / pub fn new() -> Self { [INFO] [stdout] 24 | | Self { [INFO] [stdout] 25 | | sources: IndexMap::new(), [INFO] [stdout] 26 | | } [INFO] [stdout] 27 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 21 + impl Default for TemplateEngine { [INFO] [stdout] 22 + fn default() -> Self { [INFO] [stdout] 23 + Self::new() [INFO] [stdout] 24 + } [INFO] [stdout] 25 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/utils/template/template_engine.rs:178:17 [INFO] [stdout] | [INFO] [stdout] 178 | / if s.starts_with("{{") && s.ends_with("}}") { [INFO] [stdout] 179 | | if let Ok(rule) = InterpolationParser::parse(s) { [INFO] [stdout] 180 | | if let Ok(nodes) = processor.get_nodes_for_rule(&rule, &self.sources) { [INFO] [stdout] 181 | | all_nodes.extend(nodes.clone()); [INFO] [stdout] ... | [INFO] [stdout] 188 | | } [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] 176 ~ serde_json::Value::String(s) [INFO] [stdout] 177 | // Process string: check if it's an interpolation rule (for non-array contexts) [INFO] [stdout] 178 ~ if s.starts_with("{{") && s.ends_with("}}") => { [INFO] [stdout] 179 | if let Ok(rule) = InterpolationParser::parse(s) { [INFO] [stdout] ... [INFO] [stdout] 187 | } [INFO] [stdout] 188 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/protocols/singbox/template_processor.rs:567:20 [INFO] [stdout] | [INFO] [stdout] 567 | if !skip_keys.contains(&key.as_str()) && !(is_shadowsocks && key == "udp") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(skip_keys.contains(&key.as_str()) || is_shadowsocks && key == "udp")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Result::Err` [INFO] [stdout] --> src/protocols/subscription.rs:126:20 [INFO] [stdout] | [INFO] [stdout] 126 | let name = urlencoding::decode(name_encoded) [INFO] [stdout] | ____________________^ [INFO] [stdout] 127 | | .unwrap_or_else(|_| std::borrow::Cow::Borrowed(name_encoded)) [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 `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 127 - .unwrap_or_else(|_| std::borrow::Cow::Borrowed(name_encoded)) [INFO] [stdout] 127 + .unwrap_or(std::borrow::Cow::Borrowed(name_encoded)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/utils/source/loader.rs:189:47 [INFO] [stdout] | [INFO] [stdout] 189 | std::fs::read_to_string(path).map_err(|e| ConvertError::IoError(e)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `ConvertError::IoError` [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: large size difference between variants [INFO] [stdout] --> src/utils/source/parser.rs:10:1 [INFO] [stdout] | [INFO] [stdout] 10 | / pub enum Config { [INFO] [stdout] 11 | | Clash(clash::Config), [INFO] [stdout] 12 | | SingBox(singbox::Config), [INFO] [stdout] | | ------------------------ the largest variant contains at least 1312 bytes [INFO] [stdout] 13 | | V2Ray(v2ray::Config), [INFO] [stdout] | | -------------------- the second-largest variant contains at least 384 bytes [INFO] [stdout] ... | [INFO] [stdout] 17 | | Plain(Vec), [INFO] [stdout] 18 | | } [INFO] [stdout] | |_^ the entire enum is at least 1312 bytes [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant [INFO] [stdout] help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum [INFO] [stdout] | [INFO] [stdout] 12 - SingBox(singbox::Config), [INFO] [stdout] 12 + SingBox(Box), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `TemplateEngine` [INFO] [stdout] --> src/utils/template/template_engine.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 23 | / pub fn new() -> Self { [INFO] [stdout] 24 | | Self { [INFO] [stdout] 25 | | sources: IndexMap::new(), [INFO] [stdout] 26 | | } [INFO] [stdout] 27 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 21 + impl Default for TemplateEngine { [INFO] [stdout] 22 + fn default() -> Self { [INFO] [stdout] 23 + Self::new() [INFO] [stdout] 24 + } [INFO] [stdout] 25 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/utils/template/template_engine.rs:178:17 [INFO] [stdout] | [INFO] [stdout] 178 | / if s.starts_with("{{") && s.ends_with("}}") { [INFO] [stdout] 179 | | if let Ok(rule) = InterpolationParser::parse(s) { [INFO] [stdout] 180 | | if let Ok(nodes) = processor.get_nodes_for_rule(&rule, &self.sources) { [INFO] [stdout] 181 | | all_nodes.extend(nodes.clone()); [INFO] [stdout] ... | [INFO] [stdout] 188 | | } [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] 176 ~ serde_json::Value::String(s) [INFO] [stdout] 177 | // Process string: check if it's an interpolation rule (for non-array contexts) [INFO] [stdout] 178 ~ if s.starts_with("{{") && s.ends_with("}}") => { [INFO] [stdout] 179 | if let Ok(rule) = InterpolationParser::parse(s) { [INFO] [stdout] ... [INFO] [stdout] 187 | } [INFO] [stdout] 188 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 04s [INFO] running `Command { std: "docker" "inspect" "b411acf517cd6d84e253de374c33554c3d1a3f9278d6c6171dd97b7bcd42d37e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "b411acf517cd6d84e253de374c33554c3d1a3f9278d6c6171dd97b7bcd42d37e", kill_on_drop: false }` [INFO] [stdout] b411acf517cd6d84e253de374c33554c3d1a3f9278d6c6171dd97b7bcd42d37e