[INFO] cloning repository https://github.com/juoon/evo [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/juoon/evo" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fjuoon%2Fevo", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fjuoon%2Fevo'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] ccc737d102adea4a8c0f7992d572186694f4a683 [INFO] linting juoon/evo against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fjuoon%2Fevo" "/workspace/builds/worker-3-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-3-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/juoon/evo [INFO] finished tweaking git repo https://github.com/juoon/evo [INFO] tweaked toml for git repo https://github.com/juoon/evo written to /workspace/builds/worker-3-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/juoon/evo 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/juoon/evo 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 pyo3-macros v0.22.6 [INFO] [stderr] Downloaded unindent v0.2.4 [INFO] [stderr] Downloaded pyo3-build-config v0.22.6 [INFO] [stderr] Downloaded pyo3-ffi v0.22.6 [INFO] [stderr] Downloaded pyo3-macros-backend v0.22.6 [INFO] [stderr] Downloaded pyo3 v0.22.6 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 28291a89d69c96ecef290690581e2f99416b19f40db201a8c67b12f51a23e152 [INFO] running `Command { std: "docker" "start" "-a" "28291a89d69c96ecef290690581e2f99416b19f40db201a8c67b12f51a23e152", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "28291a89d69c96ecef290690581e2f99416b19f40db201a8c67b12f51a23e152", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "28291a89d69c96ecef290690581e2f99416b19f40db201a8c67b12f51a23e152", kill_on_drop: false }` [INFO] [stdout] 28291a89d69c96ecef290690581e2f99416b19f40db201a8c67b12f51a23e152 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 69520f0c13da3c365582368f09bb8b072672c1fa629b285d5bbf16be91ec37ae [INFO] running `Command { std: "docker" "start" "-a" "69520f0c13da3c365582368f09bb8b072672c1fa629b285d5bbf16be91ec37ae", kill_on_drop: false }` [INFO] [stderr] Compiling target-lexicon v0.12.16 [INFO] [stderr] Compiling zmij v1.0.12 [INFO] [stderr] Compiling getrandom v0.3.4 [INFO] [stderr] Compiling syn v2.0.114 [INFO] [stderr] Checking clap_builder v4.5.54 [INFO] [stderr] Compiling indoc v2.0.7 [INFO] [stderr] Checking unindent v0.2.4 [INFO] [stderr] Checking serde_json v1.0.149 [INFO] [stderr] Checking uuid v1.19.0 [INFO] [stderr] Compiling pyo3-build-config v0.22.6 [INFO] [stderr] Compiling pyo3-macros-backend v0.22.6 [INFO] [stderr] Compiling pyo3-ffi v0.22.6 [INFO] [stderr] Compiling pyo3 v0.22.6 [INFO] [stderr] Compiling serde_derive v1.0.228 [INFO] [stderr] Compiling clap_derive v4.5.49 [INFO] [stderr] Checking clap v4.5.54 [INFO] [stderr] Checking serde v1.0.228 [INFO] [stderr] Compiling pyo3-macros v0.22.6 [INFO] [stderr] Checking chrono v0.4.42 [INFO] [stderr] Checking evo v1.0.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused import: `StateSnapshot` [INFO] [stdout] --> src/evolution/event_manager.rs:6:65 [INFO] [stdout] | [INFO] [stdout] 6 | use crate::evolution::tracker::{EvolutionDelta, EvolutionEvent, StateSnapshot}; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `crate::grammar::rule::GrammarRule` [INFO] [stdout] --> src/evolution/event_manager.rs:7:5 [INFO] [stdout] | [INFO] [stdout] 7 | use crate::grammar::rule::GrammarRule; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `crate::grammar::core::GrammarElement` [INFO] [stdout] --> src/evolution/quality_assessor.rs:6:5 [INFO] [stdout] | [INFO] [stdout] 6 | use crate::grammar::core::GrammarElement; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around block return value [INFO] [stdout] --> src/evolution/quality_assessor.rs:336:9 [INFO] [stdout] | [INFO] [stdout] 336 | (dimensions.readability * 0.25 [INFO] [stdout] | ^ [INFO] [stdout] ... [INFO] [stdout] 340 | + dimensions.simplicity * 0.15) [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 336 ~ dimensions.readability * 0.25 [INFO] [stdout] 337 | + dimensions.maintainability * 0.25 [INFO] [stdout] 338 | + dimensions.performance * 0.20 [INFO] [stdout] 339 | + dimensions.security * 0.15 [INFO] [stdout] 340 ~ + dimensions.simplicity * 0.15 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: ambiguous glob re-exports [INFO] [stdout] --> src/evolution/mod.rs:57:9 [INFO] [stdout] | [INFO] [stdout] 57 | pub use analyzer::*; [INFO] [stdout] | ^^^^^^^^^^^ the name `OptimizationSuggestion` in the type namespace is first re-exported here [INFO] [stdout] ... [INFO] [stdout] 68 | pub use performance::*; [INFO] [stdout] | -------------- but the name `OptimizationSuggestion` in the type namespace is also re-exported here [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(ambiguous_glob_reexports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: ambiguous glob re-exports [INFO] [stdout] --> src/evolution/mod.rs:57:9 [INFO] [stdout] | [INFO] [stdout] 57 | pub use analyzer::*; [INFO] [stdout] | ^^^^^^^^^^^ the name `SuggestionType` in the type namespace is first re-exported here [INFO] [stdout] ... [INFO] [stdout] 69 | pub use quality_assessor::*; [INFO] [stdout] | ------------------- but the name `SuggestionType` in the type namespace is also re-exported here [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: ambiguous glob re-exports [INFO] [stdout] --> src/grammar/mod.rs:22:9 [INFO] [stdout] | [INFO] [stdout] 22 | pub use core::*; [INFO] [stdout] | ^^^^^^^ the name `Pattern` in the type namespace is first re-exported here [INFO] [stdout] 23 | pub use rule::*; [INFO] [stdout] | ------- but the name `Pattern` in the type namespace is also re-exported here [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: private item shadows public glob re-export [INFO] [stdout] --> src/lib.rs:6:1 [INFO] [stdout] | [INFO] [stdout] 6 | mod parser; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the name `parser` in the type namespace is supposed to be publicly re-exported here [INFO] [stdout] --> src/lib.rs:14:9 [INFO] [stdout] | [INFO] [stdout] 14 | pub use poetry::*; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] note: but the private item here shadows it [INFO] [stdout] --> src/lib.rs:6:1 [INFO] [stdout] | [INFO] [stdout] 6 | mod parser; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = note: `#[warn(hidden_glob_reexports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `ProgrammingIntent` [INFO] [stdout] --> src/parser/context.rs:6:40 [INFO] [stdout] | [INFO] [stdout] 6 | use crate::parser::nlu::{ParsedIntent, ProgrammingIntent}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Emotion` [INFO] [stdout] --> src/poetry/parser.rs:5:30 [INFO] [stdout] | [INFO] [stdout] 5 | use crate::poetry::emotion::{Emotion, EmotionAnalysis}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Instant` [INFO] [stdout] --> src/runtime/jit.rs:9:27 [INFO] [stdout] | [INFO] [stdout] 9 | use std::time::{Duration, Instant}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Duration` [INFO] [stdout] --> src/runtime/jit_interpreter.rs:8:17 [INFO] [stdout] | [INFO] [stdout] 8 | use std::time::{Duration, Instant}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: ambiguous glob re-exports [INFO] [stdout] --> src/lib.rs:13:9 [INFO] [stdout] | [INFO] [stdout] 13 | pub use parser::*; [INFO] [stdout] | ^^^^^^^^^ the name `Location` in the type namespace is first re-exported here [INFO] [stdout] ... [INFO] [stdout] 16 | pub use runtime::*; [INFO] [stdout] | ---------- but the name `Location` in the type namespace is also re-exported here [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `StateSnapshot` [INFO] [stdout] --> src/evolution/event_manager.rs:6:65 [INFO] [stdout] | [INFO] [stdout] 6 | use crate::evolution::tracker::{EvolutionDelta, EvolutionEvent, StateSnapshot}; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `crate::grammar::rule::GrammarRule` [INFO] [stdout] --> src/evolution/event_manager.rs:7:5 [INFO] [stdout] | [INFO] [stdout] 7 | use crate::grammar::rule::GrammarRule; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `crate::grammar::core::GrammarElement` [INFO] [stdout] --> src/evolution/quality_assessor.rs:6:5 [INFO] [stdout] | [INFO] [stdout] 6 | use crate::grammar::core::GrammarElement; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around block return value [INFO] [stdout] --> src/evolution/quality_assessor.rs:336:9 [INFO] [stdout] | [INFO] [stdout] 336 | (dimensions.readability * 0.25 [INFO] [stdout] | ^ [INFO] [stdout] ... [INFO] [stdout] 340 | + dimensions.simplicity * 0.15) [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 336 ~ dimensions.readability * 0.25 [INFO] [stdout] 337 | + dimensions.maintainability * 0.25 [INFO] [stdout] 338 | + dimensions.performance * 0.20 [INFO] [stdout] 339 | + dimensions.security * 0.15 [INFO] [stdout] 340 ~ + dimensions.simplicity * 0.15 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: ambiguous glob re-exports [INFO] [stdout] --> src/evolution/mod.rs:57:9 [INFO] [stdout] | [INFO] [stdout] 57 | pub use analyzer::*; [INFO] [stdout] | ^^^^^^^^^^^ the name `OptimizationSuggestion` in the type namespace is first re-exported here [INFO] [stdout] ... [INFO] [stdout] 68 | pub use performance::*; [INFO] [stdout] | -------------- but the name `OptimizationSuggestion` in the type namespace is also re-exported here [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(ambiguous_glob_reexports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: ambiguous glob re-exports [INFO] [stdout] --> src/evolution/mod.rs:57:9 [INFO] [stdout] | [INFO] [stdout] 57 | pub use analyzer::*; [INFO] [stdout] | ^^^^^^^^^^^ the name `SuggestionType` in the type namespace is first re-exported here [INFO] [stdout] ... [INFO] [stdout] 69 | pub use quality_assessor::*; [INFO] [stdout] | ------------------- but the name `SuggestionType` in the type namespace is also re-exported here [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: ambiguous glob re-exports [INFO] [stdout] --> src/grammar/mod.rs:22:9 [INFO] [stdout] | [INFO] [stdout] 22 | pub use core::*; [INFO] [stdout] | ^^^^^^^ the name `Pattern` in the type namespace is first re-exported here [INFO] [stdout] 23 | pub use rule::*; [INFO] [stdout] | ------- but the name `Pattern` in the type namespace is also re-exported here [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: private item shadows public glob re-export [INFO] [stdout] --> src/lib.rs:6:1 [INFO] [stdout] | [INFO] [stdout] 6 | mod parser; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the name `parser` in the type namespace is supposed to be publicly re-exported here [INFO] [stdout] --> src/lib.rs:14:9 [INFO] [stdout] | [INFO] [stdout] 14 | pub use poetry::*; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] note: but the private item here shadows it [INFO] [stdout] --> src/lib.rs:6:1 [INFO] [stdout] | [INFO] [stdout] 6 | mod parser; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = note: `#[warn(hidden_glob_reexports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `ProgrammingIntent` [INFO] [stdout] --> src/parser/context.rs:6:40 [INFO] [stdout] | [INFO] [stdout] 6 | use crate::parser::nlu::{ParsedIntent, ProgrammingIntent}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Emotion` [INFO] [stdout] --> src/poetry/parser.rs:5:30 [INFO] [stdout] | [INFO] [stdout] 5 | use crate::poetry::emotion::{Emotion, EmotionAnalysis}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Instant` [INFO] [stdout] --> src/runtime/jit.rs:9:27 [INFO] [stdout] | [INFO] [stdout] 9 | use std::time::{Duration, Instant}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Duration` [INFO] [stdout] --> src/runtime/jit_interpreter.rs:8:17 [INFO] [stdout] | [INFO] [stdout] 8 | use std::time::{Duration, Instant}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: ambiguous glob re-exports [INFO] [stdout] --> src/lib.rs:13:9 [INFO] [stdout] | [INFO] [stdout] 13 | pub use parser::*; [INFO] [stdout] | ^^^^^^^^^ the name `Location` in the type namespace is first re-exported here [INFO] [stdout] ... [INFO] [stdout] 16 | pub use runtime::*; [INFO] [stdout] | ---------- but the name `Location` in the type namespace is also re-exported here [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/evolution/analyzer.rs:111:13 [INFO] [stdout] | [INFO] [stdout] 111 | let mut statistics = self.collect_statistics(ast); [INFO] [stdout] | ----^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/analyzer.rs:301:9 [INFO] [stdout] | [INFO] [stdout] 301 | ast: &[GrammarElement], [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/analyzer.rs:343:36 [INFO] [stdout] | [INFO] [stdout] 343 | fn calculate_complexity(&self, ast: &[GrammarElement], stats: &CodeStatistics) -> f64 { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/code_reviewer.rs:220:9 [INFO] [stdout] | [INFO] [stdout] 220 | ast: &[GrammarElement], [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `analysis` [INFO] [stdout] --> src/evolution/dependency.rs:133:9 [INFO] [stdout] | [INFO] [stdout] 133 | analysis: &CodeAnalysis, [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_analysis` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/evolution/doc_generator.rs:186:13 [INFO] [stdout] | [INFO] [stdout] 186 | let mut example_count = 0; [INFO] [stdout] | ----^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `template_key` [INFO] [stdout] --> src/evolution/doc_generator.rs:189:13 [INFO] [stdout] | [INFO] [stdout] 189 | let template_key = match format { [INFO] [stdout] | ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_template_key` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `content` is never read [INFO] [stdout] --> src/evolution/doc_generator.rs:183:27 [INFO] [stdout] | [INFO] [stdout] 183 | let mut content = String::new(); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `analysis` [INFO] [stdout] --> src/evolution/doc_generator.rs:309:56 [INFO] [stdout] | [INFO] [stdout] 309 | fn generate_api_doc(&self, ast: &[GrammarElement], analysis: &CodeAnalysis) -> String { [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_analysis` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `analysis` [INFO] [stdout] --> src/evolution/doc_generator.rs:332:58 [INFO] [stdout] | [INFO] [stdout] 332 | fn generate_plain_doc(&self, ast: &[GrammarElement], analysis: &CodeAnalysis) -> String { [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_analysis` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/evolution/analyzer.rs:111:13 [INFO] [stdout] | [INFO] [stdout] 111 | let mut statistics = self.collect_statistics(ast); [INFO] [stdout] | ----^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/analyzer.rs:301:9 [INFO] [stdout] | [INFO] [stdout] 301 | ast: &[GrammarElement], [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/analyzer.rs:343:36 [INFO] [stdout] | [INFO] [stdout] 343 | fn calculate_complexity(&self, ast: &[GrammarElement], stats: &CodeStatistics) -> f64 { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `node` [INFO] [stdout] --> src/evolution/knowledge.rs:359:17 [INFO] [stdout] | [INFO] [stdout] 359 | let node = self.graph.entry(entity.clone()).or_insert_with(|| { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_node` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/code_reviewer.rs:220:9 [INFO] [stdout] | [INFO] [stdout] 220 | ast: &[GrammarElement], [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `analysis` [INFO] [stdout] --> src/evolution/dependency.rs:133:9 [INFO] [stdout] | [INFO] [stdout] 133 | analysis: &CodeAnalysis, [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_analysis` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/evolution/doc_generator.rs:186:13 [INFO] [stdout] | [INFO] [stdout] 186 | let mut example_count = 0; [INFO] [stdout] | ----^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `template_key` [INFO] [stdout] --> src/evolution/doc_generator.rs:189:13 [INFO] [stdout] | [INFO] [stdout] 189 | let template_key = match format { [INFO] [stdout] | ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_template_key` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `content` is never read [INFO] [stdout] --> src/evolution/doc_generator.rs:183:27 [INFO] [stdout] | [INFO] [stdout] 183 | let mut content = String::new(); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `analysis` [INFO] [stdout] --> src/evolution/doc_generator.rs:309:56 [INFO] [stdout] | [INFO] [stdout] 309 | fn generate_api_doc(&self, ast: &[GrammarElement], analysis: &CodeAnalysis) -> String { [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_analysis` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `analysis` [INFO] [stdout] --> src/evolution/doc_generator.rs:332:58 [INFO] [stdout] | [INFO] [stdout] 332 | fn generate_plain_doc(&self, ast: &[GrammarElement], analysis: &CodeAnalysis) -> String { [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_analysis` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/performance.rs:260:39 [INFO] [stdout] | [INFO] [stdout] 260 | fn analyze_time_complexity(&self, ast: &[GrammarElement], analysis: &CodeAnalysis) -> String { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/performance.rs:276:40 [INFO] [stdout] | [INFO] [stdout] 276 | fn analyze_space_complexity(&self, ast: &[GrammarElement], analysis: &CodeAnalysis) -> String { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/performance.rs:289:39 [INFO] [stdout] | [INFO] [stdout] 289 | fn estimate_execution_time(&self, ast: &[GrammarElement], analysis: &CodeAnalysis) -> f64 { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/performance.rs:298:37 [INFO] [stdout] | [INFO] [stdout] 298 | fn estimate_memory_usage(&self, ast: &[GrammarElement], analysis: &CodeAnalysis) -> f64 { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/performance.rs:323:9 [INFO] [stdout] | [INFO] [stdout] 323 | ast: &[GrammarElement], [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `node` [INFO] [stdout] --> src/evolution/knowledge.rs:359:17 [INFO] [stdout] | [INFO] [stdout] 359 | let node = self.graph.entry(entity.clone()).or_insert_with(|| { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_node` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/performance.rs:260:39 [INFO] [stdout] | [INFO] [stdout] 260 | fn analyze_time_complexity(&self, ast: &[GrammarElement], analysis: &CodeAnalysis) -> String { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/performance.rs:276:40 [INFO] [stdout] | [INFO] [stdout] 276 | fn analyze_space_complexity(&self, ast: &[GrammarElement], analysis: &CodeAnalysis) -> String { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/performance.rs:289:39 [INFO] [stdout] | [INFO] [stdout] 289 | fn estimate_execution_time(&self, ast: &[GrammarElement], analysis: &CodeAnalysis) -> f64 { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/performance.rs:298:37 [INFO] [stdout] | [INFO] [stdout] 298 | fn estimate_memory_usage(&self, ast: &[GrammarElement], analysis: &CodeAnalysis) -> f64 { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/performance.rs:323:9 [INFO] [stdout] | [INFO] [stdout] 323 | ast: &[GrammarElement], [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `load_enhanced_bootstrap_rules` is never used [INFO] [stdout] --> src/evolution/engine.rs:875:8 [INFO] [stdout] | [INFO] [stdout] 34 | impl EvolutionEngine { [INFO] [stdout] | -------------------- associated function in this implementation [INFO] [stdout] ... [INFO] [stdout] 875 | fn load_enhanced_bootstrap_rules() -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `allow_experimental` is never read [INFO] [stdout] --> src/parser/adaptive.rs:13:5 [INFO] [stdout] | [INFO] [stdout] 9 | pub struct AdaptiveParser { [INFO] [stdout] | -------------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 13 | allow_experimental: bool, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `session_id` is never read [INFO] [stdout] --> src/parser/context.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 11 | pub struct ContextManager { [INFO] [stdout] | -------------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 19 | session_id: String, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `model_type` and `use_local` are never read [INFO] [stdout] --> src/parser/nlu.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 10 | pub struct NLUParser { [INFO] [stdout] | --------- fields in this struct [INFO] [stdout] 11 | /// 使用的模型类型 / Model type used [INFO] [stdout] 12 | model_type: ModelType, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] 13 | /// 是否使用本地模型 / Whether to use local model [INFO] [stdout] 14 | use_local: bool, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `number_patterns` is never read [INFO] [stdout] --> src/parser/nlu.rs:43:5 [INFO] [stdout] | [INFO] [stdout] 35 | struct RuleDatabase { [INFO] [stdout] | ------------ field in this struct [INFO] [stdout] ... [INFO] [stdout] 43 | number_patterns: Vec<&'static str>, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `captured_env` is never read [INFO] [stdout] --> src/runtime/interpreter.rs:37:5 [INFO] [stdout] | [INFO] [stdout] 31 | struct Function { [INFO] [stdout] | -------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 37 | captured_env: Option>, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Function` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `eval_expr_list` and `call_user_function` are never used [INFO] [stdout] --> src/runtime/interpreter.rs:119:8 [INFO] [stdout] | [INFO] [stdout] 53 | impl Interpreter { [INFO] [stdout] | ---------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 119 | fn eval_expr_list(&mut self, exprs: &[Expr]) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 2014 | fn call_user_function( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `compiled_at_timestamp` is never read [INFO] [stdout] --> src/runtime/jit.rs:31:5 [INFO] [stdout] | [INFO] [stdout] 25 | pub struct CompiledCode { [INFO] [stdout] | ------------ field in this struct [INFO] [stdout] ... [INFO] [stdout] 31 | compiled_at_timestamp: u64, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `CompiledCode` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `metrics` is never read [INFO] [stdout] --> src/runtime/mode.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 22 | pub struct ExecutionModeSelector { [INFO] [stdout] | --------------------- field in this struct [INFO] [stdout] 23 | /// 执行指标 / Execution metrics [INFO] [stdout] 24 | metrics: ExecutionMetrics, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/evolution/analyzer.rs:158:5 [INFO] [stdout] | [INFO] [stdout] 158 | / fn collect_statistics_recursive( [INFO] [stdout] 159 | | &self, [INFO] [stdout] 160 | | elements: &[GrammarElement], [INFO] [stdout] 161 | | depth: usize, [INFO] [stdout] ... | [INFO] [stdout] 166 | | total_complexity: &mut f64, [INFO] [stdout] 167 | | ) { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/analyzer.rs:241:21 [INFO] [stdout] | [INFO] [stdout] 241 | / if first == "def" || first == "function" { [INFO] [stdout] 242 | | if list.len() > 10 { [INFO] [stdout] 243 | | patterns.push(CodePattern { [INFO] [stdout] 244 | | pattern_type: PatternType::LongFunction, [INFO] [stdout] ... | [INFO] [stdout] 250 | | } [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] 241 ~ if (first == "def" || first == "function") { [INFO] [stdout] 242 ~ && list.len() > 10 { [INFO] [stdout] 243 | patterns.push(CodePattern { [INFO] [stdout] ... [INFO] [stdout] 248 | }); [INFO] [stdout] 249 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/evolution/analyzer.rs:419:29 [INFO] [stdout] | [INFO] [stdout] 419 | / ... if *b != 0 { [INFO] [stdout] 420 | | ... a / b [INFO] [stdout] 421 | | ... } else { [INFO] [stdout] 422 | | ... return expr.clone(); [INFO] [stdout] 423 | | ... } [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] 418 ~ BinOp::Div [INFO] [stdout] 419 ~ if *b != 0 => { [INFO] [stdout] 420 | a / b [INFO] [stdout] 421 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/evolution/analyzer.rs:426:29 [INFO] [stdout] | [INFO] [stdout] 426 | / ... if *b != 0 { [INFO] [stdout] 427 | | ... a % b [INFO] [stdout] 428 | | ... } else { [INFO] [stdout] 429 | | ... return expr.clone(); [INFO] [stdout] 430 | | ... } [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] 425 ~ BinOp::Mod [INFO] [stdout] 426 ~ if *b != 0 => { [INFO] [stdout] 427 | a % b [INFO] [stdout] 428 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/evolution/code_generator.rs:288:13 [INFO] [stdout] | [INFO] [stdout] 288 | / match insight.insight_type { [INFO] [stdout] 289 | | crate::evolution::learning::InsightType::CodeSimplification => { [INFO] [stdout] 290 | | // 简化代码 / Simplify code [INFO] [stdout] 291 | | if let Some(suggestion) = &insight.suggestion { [INFO] [stdout] ... | [INFO] [stdout] 299 | | _ => {} [INFO] [stdout] 300 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 288 ~ if let crate::evolution::learning::InsightType::CodeSimplification = insight.insight_type { [INFO] [stdout] 289 ~ // 简化代码 / Simplify code [INFO] [stdout] 290 + if let Some(suggestion) = &insight.suggestion { [INFO] [stdout] 291 ~ if suggestion.contains("简化") { [INFO] [stdout] 292 ~ // 应用简化规则 / Apply simplification rules [INFO] [stdout] 293 + optimized = optimized.replace("(+ 0 ", "(+ "); [INFO] [stdout] 294 + optimized = optimized.replace("(* 1 ", "(* "); [INFO] [stdout] 295 + } [INFO] [stdout] 296 + } [INFO] [stdout] 297 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/dependency.rs:176:21 [INFO] [stdout] | [INFO] [stdout] 176 | / if first == "def" || first == "function" { [INFO] [stdout] 177 | | if list.len() >= 3 { [INFO] [stdout] 178 | | if let GrammarElement::Atom(function_name) = &list[1] { [INFO] [stdout] 179 | | let mut deps = Vec::new(); [INFO] [stdout] ... | [INFO] [stdout] 189 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 176 ~ if (first == "def" || first == "function") { [INFO] [stdout] 177 ~ && list.len() >= 3 { [INFO] [stdout] 178 | if let GrammarElement::Atom(function_name) = &list[1] { [INFO] [stdout] ... [INFO] [stdout] 187 | } [INFO] [stdout] 188 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/dependency.rs:226:21 [INFO] [stdout] | [INFO] [stdout] 226 | / if first == "def" || first == "function" { [INFO] [stdout] 227 | | if list.len() >= 3 { [INFO] [stdout] 228 | | if let GrammarElement::Atom(function_name) = &list[1] { [INFO] [stdout] ... | [INFO] [stdout] 242 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 226 ~ if (first == "def" || first == "function") { [INFO] [stdout] 227 ~ && list.len() >= 3 { [INFO] [stdout] 228 | if let GrammarElement::Atom(function_name) = &list[1] { [INFO] [stdout] ... [INFO] [stdout] 240 | } [INFO] [stdout] 241 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `load_enhanced_bootstrap_rules` is never used [INFO] [stdout] --> src/evolution/engine.rs:875:8 [INFO] [stdout] | [INFO] [stdout] 34 | impl EvolutionEngine { [INFO] [stdout] | -------------------- associated function in this implementation [INFO] [stdout] ... [INFO] [stdout] 875 | fn load_enhanced_bootstrap_rules() -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `allow_experimental` is never read [INFO] [stdout] --> src/parser/adaptive.rs:13:5 [INFO] [stdout] | [INFO] [stdout] 9 | pub struct AdaptiveParser { [INFO] [stdout] | -------------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 13 | allow_experimental: bool, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `session_id` is never read [INFO] [stdout] --> src/parser/context.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 11 | pub struct ContextManager { [INFO] [stdout] | -------------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 19 | session_id: String, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `model_type` and `use_local` are never read [INFO] [stdout] --> src/parser/nlu.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 10 | pub struct NLUParser { [INFO] [stdout] | --------- fields in this struct [INFO] [stdout] 11 | /// 使用的模型类型 / Model type used [INFO] [stdout] 12 | model_type: ModelType, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] 13 | /// 是否使用本地模型 / Whether to use local model [INFO] [stdout] 14 | use_local: bool, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `number_patterns` is never read [INFO] [stdout] --> src/parser/nlu.rs:43:5 [INFO] [stdout] | [INFO] [stdout] 35 | struct RuleDatabase { [INFO] [stdout] | ------------ field in this struct [INFO] [stdout] ... [INFO] [stdout] 43 | number_patterns: Vec<&'static str>, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `captured_env` is never read [INFO] [stdout] --> src/runtime/interpreter.rs:37:5 [INFO] [stdout] | [INFO] [stdout] 31 | struct Function { [INFO] [stdout] | -------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 37 | captured_env: Option>, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Function` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `eval_expr_list` and `call_user_function` are never used [INFO] [stdout] --> src/runtime/interpreter.rs:119:8 [INFO] [stdout] | [INFO] [stdout] 53 | impl Interpreter { [INFO] [stdout] | ---------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 119 | fn eval_expr_list(&mut self, exprs: &[Expr]) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 2014 | fn call_user_function( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `compiled_at_timestamp` is never read [INFO] [stdout] --> src/runtime/jit.rs:31:5 [INFO] [stdout] | [INFO] [stdout] 25 | pub struct CompiledCode { [INFO] [stdout] | ------------ field in this struct [INFO] [stdout] ... [INFO] [stdout] 31 | compiled_at_timestamp: u64, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `CompiledCode` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `metrics` is never read [INFO] [stdout] --> src/runtime/mode.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 22 | pub struct ExecutionModeSelector { [INFO] [stdout] | --------------------- field in this struct [INFO] [stdout] 23 | /// 执行指标 / Execution metrics [INFO] [stdout] 24 | metrics: ExecutionMetrics, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/evolution/analyzer.rs:158:5 [INFO] [stdout] | [INFO] [stdout] 158 | / fn collect_statistics_recursive( [INFO] [stdout] 159 | | &self, [INFO] [stdout] 160 | | elements: &[GrammarElement], [INFO] [stdout] 161 | | depth: usize, [INFO] [stdout] ... | [INFO] [stdout] 166 | | total_complexity: &mut f64, [INFO] [stdout] 167 | | ) { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/analyzer.rs:241:21 [INFO] [stdout] | [INFO] [stdout] 241 | / if first == "def" || first == "function" { [INFO] [stdout] 242 | | if list.len() > 10 { [INFO] [stdout] 243 | | patterns.push(CodePattern { [INFO] [stdout] 244 | | pattern_type: PatternType::LongFunction, [INFO] [stdout] ... | [INFO] [stdout] 250 | | } [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] 241 ~ if (first == "def" || first == "function") { [INFO] [stdout] 242 ~ && list.len() > 10 { [INFO] [stdout] 243 | patterns.push(CodePattern { [INFO] [stdout] ... [INFO] [stdout] 248 | }); [INFO] [stdout] 249 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/evolution/analyzer.rs:419:29 [INFO] [stdout] | [INFO] [stdout] 419 | / ... if *b != 0 { [INFO] [stdout] 420 | | ... a / b [INFO] [stdout] 421 | | ... } else { [INFO] [stdout] 422 | | ... return expr.clone(); [INFO] [stdout] 423 | | ... } [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] 418 ~ BinOp::Div [INFO] [stdout] 419 ~ if *b != 0 => { [INFO] [stdout] 420 | a / b [INFO] [stdout] 421 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/evolution/analyzer.rs:426:29 [INFO] [stdout] | [INFO] [stdout] 426 | / ... if *b != 0 { [INFO] [stdout] 427 | | ... a % b [INFO] [stdout] 428 | | ... } else { [INFO] [stdout] 429 | | ... return expr.clone(); [INFO] [stdout] 430 | | ... } [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] 425 ~ BinOp::Mod [INFO] [stdout] 426 ~ if *b != 0 => { [INFO] [stdout] 427 | a % b [INFO] [stdout] 428 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/evolution/doc_generator.rs:249:23 [INFO] [stdout] | [INFO] [stdout] 249 | doc.push_str(&format!("## 概览 / Overview\n\n")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"## 概览 / Overview\n\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/doc_generator.rs:269:21 [INFO] [stdout] | [INFO] [stdout] 269 | / if first == "def" || first == "function" { [INFO] [stdout] 270 | | if list.len() >= 3 { [INFO] [stdout] 271 | | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] 272 | | doc.push_str(&format!("### {}\n\n", name)); [INFO] [stdout] ... | [INFO] [stdout] 292 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 269 ~ if (first == "def" || first == "function") { [INFO] [stdout] 270 ~ && list.len() >= 3 { [INFO] [stdout] 271 | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] ... [INFO] [stdout] 290 | } [INFO] [stdout] 291 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/evolution/doc_generator.rs:273:47 [INFO] [stdout] | [INFO] [stdout] 273 | ... doc.push_str(&format!("**描述 / Description**: 函数定义\n\n")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"**描述 / Description**: 函数定义\n\n".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: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/evolution/doc_generator.rs:283:37 [INFO] [stdout] | [INFO] [stdout] 283 | ... doc.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `doc.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/doc_generator.rs:316:21 [INFO] [stdout] | [INFO] [stdout] 316 | / if first == "def" || first == "function" { [INFO] [stdout] 317 | | if list.len() >= 3 { [INFO] [stdout] 318 | | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] 319 | | doc.push_str(&format!("### `{}`\n\n", name)); [INFO] [stdout] ... | [INFO] [stdout] 323 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 316 ~ if (first == "def" || first == "function") { [INFO] [stdout] 317 ~ && list.len() >= 3 { [INFO] [stdout] 318 | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] ... [INFO] [stdout] 321 | } [INFO] [stdout] 322 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/doc_generator.rs:338:21 [INFO] [stdout] | [INFO] [stdout] 338 | / if first == "def" || first == "function" { [INFO] [stdout] 339 | | if list.len() >= 3 { [INFO] [stdout] 340 | | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] 341 | | doc.push_str(&format!(";; 函数: {}\n", name)); [INFO] [stdout] ... | [INFO] [stdout] 346 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 338 ~ if (first == "def" || first == "function") { [INFO] [stdout] 339 ~ && list.len() >= 3 { [INFO] [stdout] 340 | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] ... [INFO] [stdout] 344 | } [INFO] [stdout] 345 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/evolution/doc_generator.rs:343:33 [INFO] [stdout] | [INFO] [stdout] 343 | ... doc.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `doc.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/evolution/code_generator.rs:288:13 [INFO] [stdout] | [INFO] [stdout] 288 | / match insight.insight_type { [INFO] [stdout] 289 | | crate::evolution::learning::InsightType::CodeSimplification => { [INFO] [stdout] 290 | | // 简化代码 / Simplify code [INFO] [stdout] 291 | | if let Some(suggestion) = &insight.suggestion { [INFO] [stdout] ... | [INFO] [stdout] 299 | | _ => {} [INFO] [stdout] 300 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 288 ~ if let crate::evolution::learning::InsightType::CodeSimplification = insight.insight_type { [INFO] [stdout] 289 ~ // 简化代码 / Simplify code [INFO] [stdout] 290 + if let Some(suggestion) = &insight.suggestion { [INFO] [stdout] 291 ~ if suggestion.contains("简化") { [INFO] [stdout] 292 ~ // 应用简化规则 / Apply simplification rules [INFO] [stdout] 293 + optimized = optimized.replace("(+ 0 ", "(+ "); [INFO] [stdout] 294 + optimized = optimized.replace("(* 1 ", "(* "); [INFO] [stdout] 295 + } [INFO] [stdout] 296 + } [INFO] [stdout] 297 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/evolution/engine.rs:452:22 [INFO] [stdout] | [INFO] [stdout] 452 | .map_err(|e| EvolutionError::IntegrationFailed(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EvolutionError::IntegrationFailed` [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/evolution/engine.rs:470:22 [INFO] [stdout] | [INFO] [stdout] 470 | .map_err(|e| EvolutionError::IntegrationFailed(e)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EvolutionError::IntegrationFailed` [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/evolution/engine.rs:480:22 [INFO] [stdout] | [INFO] [stdout] 480 | .map_err(|e| EvolutionError::IntegrationFailed(e)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EvolutionError::IntegrationFailed` [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: useless use of `format!` [INFO] [stdout] --> src/evolution/engine.rs:807:17 [INFO] [stdout] | [INFO] [stdout] 807 | format!("(def nostalgia () \"思念故乡的情感\")") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"(def nostalgia () \"思念故乡的情感\")".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] --> src/evolution/engine.rs:810:17 [INFO] [stdout] | [INFO] [stdout] 810 | format!("(def tranquility () \"夜晚的宁静,内心的平和\")") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"(def tranquility () \"夜晚的宁静,内心的平和\")".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] --> src/evolution/engine.rs:813:17 [INFO] [stdout] | [INFO] [stdout] 813 | format!("(def loneliness () \"孤独感,缺少陪伴\")") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"(def loneliness () \"孤独感,缺少陪伴\")".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: redundant closure [INFO] [stdout] --> src/evolution/event_manager.rs:30:54 [INFO] [stdout] | [INFO] [stdout] 30 | fs::create_dir_all(&self.events_dir).map_err(|e| EventManagerError::IoError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EventManagerError::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/evolution/event_manager.rs:38:22 [INFO] [stdout] | [INFO] [stdout] 38 | .map_err(|e| EventManagerError::SerializationError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EventManagerError::SerializationError` [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/evolution/event_manager.rs:41:44 [INFO] [stdout] | [INFO] [stdout] 41 | fs::write(&filepath, json).map_err(|e| EventManagerError::IoError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EventManagerError::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/evolution/event_manager.rs:52:61 [INFO] [stdout] | [INFO] [stdout] 52 | let content = fs::read_to_string(&filepath).map_err(|e| EventManagerError::IoError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EventManagerError::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/evolution/event_manager.rs:56:22 [INFO] [stdout] | [INFO] [stdout] 56 | .map_err(|e| EventManagerError::DeserializationError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EventManagerError::DeserializationError` [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/evolution/event_manager.rs:71:62 [INFO] [stdout] | [INFO] [stdout] 71 | let entries = fs::read_dir(&self.events_dir).map_err(|e| EventManagerError::IoError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EventManagerError::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/evolution/event_manager.rs:74:39 [INFO] [stdout] | [INFO] [stdout] 74 | let entry = entry.map_err(|e| EventManagerError::IoError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EventManagerError::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: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/event_manager.rs:88:9 [INFO] [stdout] | [INFO] [stdout] 88 | events.sort_by(|a, b| a.timestamp.cmp(&b.timestamp)); [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] 88 - events.sort_by(|a, b| a.timestamp.cmp(&b.timestamp)); [INFO] [stdout] 88 + events.sort_by_key(|a| a.timestamp); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/event_manager.rs:204:9 [INFO] [stdout] | [INFO] [stdout] 204 | sorted_events.sort_by(|a, b| a.timestamp.cmp(&b.timestamp)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 204 - sorted_events.sort_by(|a, b| a.timestamp.cmp(&b.timestamp)); [INFO] [stdout] 204 + sorted_events.sort_by_key(|a| a.timestamp); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/evolution/knowledge.rs:210:16 [INFO] [stdout] | [INFO] [stdout] 210 | if rule1.pattern.elements.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!rule1.pattern.elements.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` has identical blocks [INFO] [stdout] --> src/evolution/knowledge.rs:362:51 [INFO] [stdout] | [INFO] [stdout] 362 | if entity.starts_with("emotion:") { [INFO] [stdout] | ___________________________________________________^ [INFO] [stdout] 363 | | n.node_type = NodeType::Concept; [INFO] [stdout] 364 | | } else if entity.starts_with("theme:") { [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/evolution/knowledge.rs:364:56 [INFO] [stdout] | [INFO] [stdout] 364 | } else if entity.starts_with("theme:") { [INFO] [stdout] | ________________________________________________________^ [INFO] [stdout] 365 | | n.node_type = NodeType::Concept; [INFO] [stdout] 366 | | } else if entity.starts_with("imagery:") { [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 `if` has identical blocks [INFO] [stdout] --> src/evolution/knowledge.rs:364:56 [INFO] [stdout] | [INFO] [stdout] 364 | } else if entity.starts_with("theme:") { [INFO] [stdout] | ________________________________________________________^ [INFO] [stdout] 365 | | n.node_type = NodeType::Concept; [INFO] [stdout] 366 | | } else if entity.starts_with("imagery:") { [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/evolution/knowledge.rs:366:58 [INFO] [stdout] | [INFO] [stdout] 366 | } else if entity.starts_with("imagery:") { [INFO] [stdout] | __________________________________________________________^ [INFO] [stdout] 367 | | n.node_type = NodeType::Concept; [INFO] [stdout] 368 | | } [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] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `PatternMiner` [INFO] [stdout] --> src/evolution/knowledge.rs:477:5 [INFO] [stdout] | [INFO] [stdout] 477 | / pub fn new() -> Self { [INFO] [stdout] 478 | | Self { [INFO] [stdout] 479 | | patterns: Vec::new(), [INFO] [stdout] 480 | | } [INFO] [stdout] 481 | | } [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] 475 + impl Default for PatternMiner { [INFO] [stdout] 476 + fn default() -> Self { [INFO] [stdout] 477 + Self::new() [INFO] [stdout] 478 + } [INFO] [stdout] 479 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/evolution/knowledge.rs:494:22 [INFO] [stdout] | [INFO] [stdout] 494 | .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: redundant closure [INFO] [stdout] --> src/evolution/learning.rs:78:29 [INFO] [stdout] | [INFO] [stdout] 78 | .or_insert_with(|| Vec::new()) [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Vec::new` [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/evolution/learning.rs:101:29 [INFO] [stdout] | [INFO] [stdout] 101 | .or_insert_with(|| Vec::new()) [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Vec::new` [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: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/learning.rs:136:9 [INFO] [stdout] | [INFO] [stdout] 136 | patterns.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] help: try [INFO] [stdout] | [INFO] [stdout] 136 - patterns.sort_by(|a, b| b.1.cmp(&a.1)); [INFO] [stdout] 136 + patterns.sort_by_key(|b| std::cmp::Reverse(b.1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/learning.rs:147:9 [INFO] [stdout] | [INFO] [stdout] 147 | all_errors.sort_by(|a, b| b.count.cmp(&a.count)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 147 - all_errors.sort_by(|a, b| b.count.cmp(&a.count)); [INFO] [stdout] 147 + all_errors.sort_by_key(|b| std::cmp::Reverse(b.count)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/learning.rs:159:9 [INFO] [stdout] | [INFO] [stdout] 159 | all_patterns.sort_by(|a, b| b.usage_count.cmp(&a.usage_count)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 159 - all_patterns.sort_by(|a, b| b.usage_count.cmp(&a.usage_count)); [INFO] [stdout] 159 + all_patterns.sort_by_key(|b| std::cmp::Reverse(b.usage_count)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/learning.rs:180:9 [INFO] [stdout] | [INFO] [stdout] 180 | insights.sort_by(|a, b| b.priority.cmp(&a.priority)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 180 - insights.sort_by(|a, b| b.priority.cmp(&a.priority)); [INFO] [stdout] 180 + insights.sort_by_key(|b| std::cmp::Reverse(b.priority)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/learning.rs:203:9 [INFO] [stdout] | [INFO] [stdout] 203 | insights.sort_by(|a, b| b.priority.cmp(&a.priority)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 203 - insights.sort_by(|a, b| b.priority.cmp(&a.priority)); [INFO] [stdout] 203 + insights.sort_by_key(|b| std::cmp::Reverse(b.priority)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/learning.rs:211:9 [INFO] [stdout] | [INFO] [stdout] 211 | insights.sort_by(|a, b| b.priority.cmp(&a.priority)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 211 - insights.sort_by(|a, b| b.priority.cmp(&a.priority)); [INFO] [stdout] 211 + insights.sort_by_key(|b| std::cmp::Reverse(b.priority)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/dependency.rs:176:21 [INFO] [stdout] | [INFO] [stdout] 176 | / if first == "def" || first == "function" { [INFO] [stdout] 177 | | if list.len() >= 3 { [INFO] [stdout] 178 | | if let GrammarElement::Atom(function_name) = &list[1] { [INFO] [stdout] 179 | | let mut deps = Vec::new(); [INFO] [stdout] ... | [INFO] [stdout] 189 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 176 ~ if (first == "def" || first == "function") { [INFO] [stdout] 177 ~ && list.len() >= 3 { [INFO] [stdout] 178 | if let GrammarElement::Atom(function_name) = &list[1] { [INFO] [stdout] ... [INFO] [stdout] 187 | } [INFO] [stdout] 188 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/dependency.rs:226:21 [INFO] [stdout] | [INFO] [stdout] 226 | / if first == "def" || first == "function" { [INFO] [stdout] 227 | | if list.len() >= 3 { [INFO] [stdout] 228 | | if let GrammarElement::Atom(function_name) = &list[1] { [INFO] [stdout] ... | [INFO] [stdout] 242 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 226 ~ if (first == "def" || first == "function") { [INFO] [stdout] 227 ~ && list.len() >= 3 { [INFO] [stdout] 228 | if let GrammarElement::Atom(function_name) = &list[1] { [INFO] [stdout] ... [INFO] [stdout] 240 | } [INFO] [stdout] 241 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/performance.rs:454:9 [INFO] [stdout] | [INFO] [stdout] 454 | score.max(0.0).min(100.0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `score.clamp(0.0, 100.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] = note: `#[warn(clippy::manual_clamp)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/evolution/doc_generator.rs:249:23 [INFO] [stdout] | [INFO] [stdout] 249 | doc.push_str(&format!("## 概览 / Overview\n\n")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"## 概览 / Overview\n\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/doc_generator.rs:269:21 [INFO] [stdout] | [INFO] [stdout] 269 | / if first == "def" || first == "function" { [INFO] [stdout] 270 | | if list.len() >= 3 { [INFO] [stdout] 271 | | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] 272 | | doc.push_str(&format!("### {}\n\n", name)); [INFO] [stdout] ... | [INFO] [stdout] 292 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 269 ~ if (first == "def" || first == "function") { [INFO] [stdout] 270 ~ && list.len() >= 3 { [INFO] [stdout] 271 | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] ... [INFO] [stdout] 290 | } [INFO] [stdout] 291 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/evolution/doc_generator.rs:273:47 [INFO] [stdout] | [INFO] [stdout] 273 | ... doc.push_str(&format!("**描述 / Description**: 函数定义\n\n")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"**描述 / Description**: 函数定义\n\n".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: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/evolution/doc_generator.rs:283:37 [INFO] [stdout] | [INFO] [stdout] 283 | ... doc.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `doc.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/doc_generator.rs:316:21 [INFO] [stdout] | [INFO] [stdout] 316 | / if first == "def" || first == "function" { [INFO] [stdout] 317 | | if list.len() >= 3 { [INFO] [stdout] 318 | | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] 319 | | doc.push_str(&format!("### `{}`\n\n", name)); [INFO] [stdout] ... | [INFO] [stdout] 323 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 316 ~ if (first == "def" || first == "function") { [INFO] [stdout] 317 ~ && list.len() >= 3 { [INFO] [stdout] 318 | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] ... [INFO] [stdout] 321 | } [INFO] [stdout] 322 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/doc_generator.rs:338:21 [INFO] [stdout] | [INFO] [stdout] 338 | / if first == "def" || first == "function" { [INFO] [stdout] 339 | | if list.len() >= 3 { [INFO] [stdout] 340 | | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] 341 | | doc.push_str(&format!(";; 函数: {}\n", name)); [INFO] [stdout] ... | [INFO] [stdout] 346 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 338 ~ if (first == "def" || first == "function") { [INFO] [stdout] 339 ~ && list.len() >= 3 { [INFO] [stdout] 340 | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] ... [INFO] [stdout] 344 | } [INFO] [stdout] 345 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/evolution/doc_generator.rs:343:33 [INFO] [stdout] | [INFO] [stdout] 343 | ... doc.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `doc.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/evolution/engine.rs:452:22 [INFO] [stdout] | [INFO] [stdout] 452 | .map_err(|e| EvolutionError::IntegrationFailed(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EvolutionError::IntegrationFailed` [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/evolution/engine.rs:470:22 [INFO] [stdout] | [INFO] [stdout] 470 | .map_err(|e| EvolutionError::IntegrationFailed(e)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EvolutionError::IntegrationFailed` [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/evolution/engine.rs:480:22 [INFO] [stdout] | [INFO] [stdout] 480 | .map_err(|e| EvolutionError::IntegrationFailed(e)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EvolutionError::IntegrationFailed` [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: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/quality_assessor.rs:249:9 [INFO] [stdout] | [INFO] [stdout] 249 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(score as f64).clamp(0.0_f64, 100.0_f64)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`f64` -> `f64`) [INFO] [stdout] --> src/evolution/quality_assessor.rs:249:9 [INFO] [stdout] | [INFO] [stdout] 249 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `score` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/quality_assessor.rs:269:9 [INFO] [stdout] | [INFO] [stdout] 269 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(score as f64).clamp(0.0_f64, 100.0_f64)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`f64` -> `f64`) [INFO] [stdout] --> src/evolution/quality_assessor.rs:269:9 [INFO] [stdout] | [INFO] [stdout] 269 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `score` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/quality_assessor.rs:288:9 [INFO] [stdout] | [INFO] [stdout] 288 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(score as f64).clamp(0.0_f64, 100.0_f64)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`f64` -> `f64`) [INFO] [stdout] --> src/evolution/quality_assessor.rs:288:9 [INFO] [stdout] | [INFO] [stdout] 288 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `score` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/quality_assessor.rs:305:9 [INFO] [stdout] | [INFO] [stdout] 305 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(score as f64).clamp(0.0_f64, 100.0_f64)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`f64` -> `f64`) [INFO] [stdout] --> src/evolution/quality_assessor.rs:305:9 [INFO] [stdout] | [INFO] [stdout] 305 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `score` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/quality_assessor.rs:330:9 [INFO] [stdout] | [INFO] [stdout] 330 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(score as f64).clamp(0.0_f64, 100.0_f64)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`f64` -> `f64`) [INFO] [stdout] --> src/evolution/quality_assessor.rs:330:9 [INFO] [stdout] | [INFO] [stdout] 330 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `score` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/evolution/engine.rs:807:17 [INFO] [stdout] | [INFO] [stdout] 807 | format!("(def nostalgia () \"思念故乡的情感\")") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"(def nostalgia () \"思念故乡的情感\")".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] --> src/evolution/engine.rs:810:17 [INFO] [stdout] | [INFO] [stdout] 810 | format!("(def tranquility () \"夜晚的宁静,内心的平和\")") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"(def tranquility () \"夜晚的宁静,内心的平和\")".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] --> src/evolution/engine.rs:813:17 [INFO] [stdout] | [INFO] [stdout] 813 | format!("(def loneliness () \"孤独感,缺少陪伴\")") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"(def loneliness () \"孤独感,缺少陪伴\")".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: `format!` in `format!` args [INFO] [stdout] --> src/evolution/quality_assessor.rs:417:30 [INFO] [stdout] | [INFO] [stdout] 417 | improvement: format!( [INFO] [stdout] | ______________________________^ [INFO] [stdout] 418 | | "{}: {} -> {}", [INFO] [stdout] 419 | | format!("{:?}", suggestion.suggestion_type), [INFO] [stdout] 420 | | suggestion.original, [INFO] [stdout] 421 | | suggestion.suggested [INFO] [stdout] 422 | | ), [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: combine the `format!(..)` arguments with the outer `format!(..)` call [INFO] [stdout] = help: or consider changing `format!` to `format_args!` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args [INFO] [stdout] = note: `#[warn(clippy::format_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/evolution/event_manager.rs:30:54 [INFO] [stdout] | [INFO] [stdout] 30 | fs::create_dir_all(&self.events_dir).map_err(|e| EventManagerError::IoError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EventManagerError::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/evolution/event_manager.rs:38:22 [INFO] [stdout] | [INFO] [stdout] 38 | .map_err(|e| EventManagerError::SerializationError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EventManagerError::SerializationError` [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/evolution/event_manager.rs:41:44 [INFO] [stdout] | [INFO] [stdout] 41 | fs::write(&filepath, json).map_err(|e| EventManagerError::IoError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EventManagerError::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/evolution/event_manager.rs:52:61 [INFO] [stdout] | [INFO] [stdout] 52 | let content = fs::read_to_string(&filepath).map_err(|e| EventManagerError::IoError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EventManagerError::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/evolution/event_manager.rs:56:22 [INFO] [stdout] | [INFO] [stdout] 56 | .map_err(|e| EventManagerError::DeserializationError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EventManagerError::DeserializationError` [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/evolution/event_manager.rs:71:62 [INFO] [stdout] | [INFO] [stdout] 71 | let entries = fs::read_dir(&self.events_dir).map_err(|e| EventManagerError::IoError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EventManagerError::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/evolution/event_manager.rs:74:39 [INFO] [stdout] | [INFO] [stdout] 74 | let entry = entry.map_err(|e| EventManagerError::IoError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EventManagerError::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: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/event_manager.rs:88:9 [INFO] [stdout] | [INFO] [stdout] 88 | events.sort_by(|a, b| a.timestamp.cmp(&b.timestamp)); [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] 88 - events.sort_by(|a, b| a.timestamp.cmp(&b.timestamp)); [INFO] [stdout] 88 + events.sort_by_key(|a| a.timestamp); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/event_manager.rs:204:9 [INFO] [stdout] | [INFO] [stdout] 204 | sorted_events.sort_by(|a, b| a.timestamp.cmp(&b.timestamp)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 204 - sorted_events.sort_by(|a, b| a.timestamp.cmp(&b.timestamp)); [INFO] [stdout] 204 + sorted_events.sort_by_key(|a| a.timestamp); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/evolution/knowledge.rs:210:16 [INFO] [stdout] | [INFO] [stdout] 210 | if rule1.pattern.elements.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!rule1.pattern.elements.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` has identical blocks [INFO] [stdout] --> src/evolution/knowledge.rs:362:51 [INFO] [stdout] | [INFO] [stdout] 362 | if entity.starts_with("emotion:") { [INFO] [stdout] | ___________________________________________________^ [INFO] [stdout] 363 | | n.node_type = NodeType::Concept; [INFO] [stdout] 364 | | } else if entity.starts_with("theme:") { [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/evolution/knowledge.rs:364:56 [INFO] [stdout] | [INFO] [stdout] 364 | } else if entity.starts_with("theme:") { [INFO] [stdout] | ________________________________________________________^ [INFO] [stdout] 365 | | n.node_type = NodeType::Concept; [INFO] [stdout] 366 | | } else if entity.starts_with("imagery:") { [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 `if` has identical blocks [INFO] [stdout] --> src/evolution/knowledge.rs:364:56 [INFO] [stdout] | [INFO] [stdout] 364 | } else if entity.starts_with("theme:") { [INFO] [stdout] | ________________________________________________________^ [INFO] [stdout] 365 | | n.node_type = NodeType::Concept; [INFO] [stdout] 366 | | } else if entity.starts_with("imagery:") { [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/evolution/knowledge.rs:366:58 [INFO] [stdout] | [INFO] [stdout] 366 | } else if entity.starts_with("imagery:") { [INFO] [stdout] | __________________________________________________________^ [INFO] [stdout] 367 | | n.node_type = NodeType::Concept; [INFO] [stdout] 368 | | } [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] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/similarity.rs:112:37 [INFO] [stdout] | [INFO] [stdout] 112 | self.similarity_threshold = threshold.max(0.0).min(1.0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `threshold.clamp(0.0, 1.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `PatternMiner` [INFO] [stdout] --> src/evolution/knowledge.rs:477:5 [INFO] [stdout] | [INFO] [stdout] 477 | / pub fn new() -> Self { [INFO] [stdout] 478 | | Self { [INFO] [stdout] 479 | | patterns: Vec::new(), [INFO] [stdout] 480 | | } [INFO] [stdout] 481 | | } [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] 475 + impl Default for PatternMiner { [INFO] [stdout] 476 + fn default() -> Self { [INFO] [stdout] 477 + Self::new() [INFO] [stdout] 478 + } [INFO] [stdout] 479 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/evolution/knowledge.rs:494:22 [INFO] [stdout] | [INFO] [stdout] 494 | .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: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/evolution/similarity.rs:341:18 [INFO] [stdout] | [INFO] [stdout] 341 | .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] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/similarity.rs:365:9 [INFO] [stdout] | [INFO] [stdout] 365 | duplicates.sort_by(|a, b| b.count.cmp(&a.count)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 365 - duplicates.sort_by(|a, b| b.count.cmp(&a.count)); [INFO] [stdout] 365 + duplicates.sort_by_key(|b| std::cmp::Reverse(b.count)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/similarity.rs:441:9 [INFO] [stdout] | [INFO] [stdout] 441 | score.max(0.0).min(100.0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `score.clamp(0.0, 100.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/evolution/learning.rs:78:29 [INFO] [stdout] | [INFO] [stdout] 78 | .or_insert_with(|| Vec::new()) [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Vec::new` [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/evolution/learning.rs:101:29 [INFO] [stdout] | [INFO] [stdout] 101 | .or_insert_with(|| Vec::new()) [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Vec::new` [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: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/learning.rs:136:9 [INFO] [stdout] | [INFO] [stdout] 136 | patterns.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] help: try [INFO] [stdout] | [INFO] [stdout] 136 - patterns.sort_by(|a, b| b.1.cmp(&a.1)); [INFO] [stdout] 136 + patterns.sort_by_key(|b| std::cmp::Reverse(b.1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/learning.rs:147:9 [INFO] [stdout] | [INFO] [stdout] 147 | all_errors.sort_by(|a, b| b.count.cmp(&a.count)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 147 - all_errors.sort_by(|a, b| b.count.cmp(&a.count)); [INFO] [stdout] 147 + all_errors.sort_by_key(|b| std::cmp::Reverse(b.count)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/learning.rs:159:9 [INFO] [stdout] | [INFO] [stdout] 159 | all_patterns.sort_by(|a, b| b.usage_count.cmp(&a.usage_count)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 159 - all_patterns.sort_by(|a, b| b.usage_count.cmp(&a.usage_count)); [INFO] [stdout] 159 + all_patterns.sort_by_key(|b| std::cmp::Reverse(b.usage_count)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/learning.rs:180:9 [INFO] [stdout] | [INFO] [stdout] 180 | insights.sort_by(|a, b| b.priority.cmp(&a.priority)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 180 - insights.sort_by(|a, b| b.priority.cmp(&a.priority)); [INFO] [stdout] 180 + insights.sort_by_key(|b| std::cmp::Reverse(b.priority)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/learning.rs:203:9 [INFO] [stdout] | [INFO] [stdout] 203 | insights.sort_by(|a, b| b.priority.cmp(&a.priority)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 203 - insights.sort_by(|a, b| b.priority.cmp(&a.priority)); [INFO] [stdout] 203 + insights.sort_by_key(|b| std::cmp::Reverse(b.priority)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/learning.rs:211:9 [INFO] [stdout] | [INFO] [stdout] 211 | insights.sort_by(|a, b| b.priority.cmp(&a.priority)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 211 - insights.sort_by(|a, b| b.priority.cmp(&a.priority)); [INFO] [stdout] 211 + insights.sort_by_key(|b| std::cmp::Reverse(b.priority)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/test_generator.rs:173:21 [INFO] [stdout] | [INFO] [stdout] 173 | / if first == "def" || first == "function" { [INFO] [stdout] 174 | | if list.len() >= 3 { [INFO] [stdout] 175 | | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] ... | [INFO] [stdout] 185 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 173 ~ if (first == "def" || first == "function") { [INFO] [stdout] 174 ~ && list.len() >= 3 { [INFO] [stdout] 175 | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] ... [INFO] [stdout] 183 | } [INFO] [stdout] 184 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/evolution/test_generator.rs:332:37 [INFO] [stdout] | [INFO] [stdout] 332 | let statement_coverage = if test_cases.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!test_cases.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/tracker.rs:47:21 [INFO] [stdout] | [INFO] [stdout] 47 | / if new_rule.name.contains(&old_rule.name) [INFO] [stdout] 48 | | || old_rule.name.contains(&new_rule.name) [INFO] [stdout] 49 | | || new_rule.name == old_rule.name [INFO] [stdout] ... | [INFO] [stdout] 54 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 47 ~ if (new_rule.name.contains(&old_rule.name) [INFO] [stdout] 48 | || old_rule.name.contains(&new_rule.name) [INFO] [stdout] 49 ~ || new_rule.name == old_rule.name [INFO] [stdout] 50 ~ || new_rule.name == old_rule.name) [INFO] [stdout] 51 | { [INFO] [stdout] 52 ~ && !parents.contains(&prev_event.id) { [INFO] [stdout] 53 | parents.push(prev_event.id); [INFO] [stdout] 54 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/tracker.rs:61:21 [INFO] [stdout] | [INFO] [stdout] 61 | / if prev_new_rule.name == new_rule.name { [INFO] [stdout] 62 | | if !parents.contains(&prev_event.id) { [INFO] [stdout] 63 | | parents.push(prev_event.id); [INFO] [stdout] 64 | | } [INFO] [stdout] 65 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 61 ~ if prev_new_rule.name == new_rule.name [INFO] [stdout] 62 ~ && !parents.contains(&prev_event.id) { [INFO] [stdout] 63 | parents.push(prev_event.id); [INFO] [stdout] 64 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `EvolutionGenealogy` [INFO] [stdout] --> src/evolution/tracker.rs:334:5 [INFO] [stdout] | [INFO] [stdout] 334 | / pub fn new() -> Self { [INFO] [stdout] 335 | | Self { [INFO] [stdout] 336 | | lineages: std::collections::HashMap::new(), [INFO] [stdout] 337 | | } [INFO] [stdout] 338 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 332 + impl Default for EvolutionGenealogy { [INFO] [stdout] 333 + fn default() -> Self { [INFO] [stdout] 334 + Self::new() [INFO] [stdout] 335 + } [INFO] [stdout] 336 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/evolution/tracker.rs:345:18 [INFO] [stdout] | [INFO] [stdout] 345 | .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] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/performance.rs:454:9 [INFO] [stdout] | [INFO] [stdout] 454 | score.max(0.0).min(100.0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `score.clamp(0.0, 100.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] = note: `#[warn(clippy::manual_clamp)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/quality_assessor.rs:249:9 [INFO] [stdout] | [INFO] [stdout] 249 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(score as f64).clamp(0.0_f64, 100.0_f64)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`f64` -> `f64`) [INFO] [stdout] --> src/evolution/quality_assessor.rs:249:9 [INFO] [stdout] | [INFO] [stdout] 249 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `score` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/quality_assessor.rs:269:9 [INFO] [stdout] | [INFO] [stdout] 269 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(score as f64).clamp(0.0_f64, 100.0_f64)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`f64` -> `f64`) [INFO] [stdout] --> src/evolution/quality_assessor.rs:269:9 [INFO] [stdout] | [INFO] [stdout] 269 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `score` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/quality_assessor.rs:288:9 [INFO] [stdout] | [INFO] [stdout] 288 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(score as f64).clamp(0.0_f64, 100.0_f64)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`f64` -> `f64`) [INFO] [stdout] --> src/evolution/quality_assessor.rs:288:9 [INFO] [stdout] | [INFO] [stdout] 288 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `score` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/quality_assessor.rs:305:9 [INFO] [stdout] | [INFO] [stdout] 305 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(score as f64).clamp(0.0_f64, 100.0_f64)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/parser/adaptive.rs:57:16 [INFO] [stdout] | [INFO] [stdout] 57 | && !atom.parse::().is_ok() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `atom.parse::().is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/parser/adaptive.rs:58:16 [INFO] [stdout] | [INFO] [stdout] 58 | && !atom.parse::().is_ok() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `atom.parse::().is_err()` [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: name `EOF` contains a capitalized acronym [INFO] [stdout] --> src/parser/adaptive.rs:85:5 [INFO] [stdout] | [INFO] [stdout] 85 | EOF, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter (notice the capitalization): `Eof` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`f64` -> `f64`) [INFO] [stdout] --> src/evolution/quality_assessor.rs:305:9 [INFO] [stdout] | [INFO] [stdout] 305 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `score` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/quality_assessor.rs:330:9 [INFO] [stdout] | [INFO] [stdout] 330 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(score as f64).clamp(0.0_f64, 100.0_f64)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`f64` -> `f64`) [INFO] [stdout] --> src/evolution/quality_assessor.rs:330:9 [INFO] [stdout] | [INFO] [stdout] 330 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `score` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `format!` in `format!` args [INFO] [stdout] --> src/evolution/quality_assessor.rs:417:30 [INFO] [stdout] | [INFO] [stdout] 417 | improvement: format!( [INFO] [stdout] | ______________________________^ [INFO] [stdout] 418 | | "{}: {} -> {}", [INFO] [stdout] 419 | | format!("{:?}", suggestion.suggestion_type), [INFO] [stdout] 420 | | suggestion.original, [INFO] [stdout] 421 | | suggestion.suggested [INFO] [stdout] 422 | | ), [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: combine the `format!(..)` arguments with the outer `format!(..)` call [INFO] [stdout] = help: or consider changing `format!` to `format_args!` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args [INFO] [stdout] = note: `#[warn(clippy::format_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/parser/adaptive.rs:824:29 [INFO] [stdout] | [INFO] [stdout] 824 | / ... if !self.check(&Token::RightParen) { [INFO] [stdout] 825 | | ... // 后面还有元素,name 是变量名 [INFO] [stdout] 826 | | ... Some(name.clone()) [INFO] [stdout] 827 | | ... } else { [INFO] [stdout] ... | [INFO] [stdout] 833 | | ... }))); [INFO] [stdout] 834 | | ... } [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] 822 ~ GrammarElement::Atom(name) [INFO] [stdout] 823 | // 检查后面是否还有元素(不是右括号) [INFO] [stdout] 824 ~ if !self.check(&Token::RightParen) => { [INFO] [stdout] 825 | // 后面还有元素,name 是变量名 [INFO] [stdout] 826 | Some(name.clone()) [INFO] [stdout] 827 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/similarity.rs:112:37 [INFO] [stdout] | [INFO] [stdout] 112 | self.similarity_threshold = threshold.max(0.0).min(1.0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `threshold.clamp(0.0, 1.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/evolution/similarity.rs:341:18 [INFO] [stdout] | [INFO] [stdout] 341 | .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] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/similarity.rs:365:9 [INFO] [stdout] | [INFO] [stdout] 365 | duplicates.sort_by(|a, b| b.count.cmp(&a.count)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 365 - duplicates.sort_by(|a, b| b.count.cmp(&a.count)); [INFO] [stdout] 365 + duplicates.sort_by_key(|b| std::cmp::Reverse(b.count)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/similarity.rs:441:9 [INFO] [stdout] | [INFO] [stdout] 441 | score.max(0.0).min(100.0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `score.clamp(0.0, 100.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/parser/context.rs:79:25 [INFO] [stdout] | [INFO] [stdout] 79 | / if let GrammarElement::Atom(name) = first { [INFO] [stdout] 80 | | // 存储函数定义 / Store function definition [INFO] [stdout] 81 | | self.functions.insert(name.clone(), intent.clone()); [INFO] [stdout] 82 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/parser/context.rs:78:33 [INFO] [stdout] | [INFO] [stdout] 78 | if let Some(first) = intent.code_structure.first() { [INFO] [stdout] | ^^^^^ replace this binding [INFO] [stdout] 79 | if let GrammarElement::Atom(name) = first { [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` has identical blocks [INFO] [stdout] --> src/parser/explainer.rs:86:23 [INFO] [stdout] | [INFO] [stdout] 86 | if i == 0 { [INFO] [stdout] | _______________________^ [INFO] [stdout] 87 | | parts.push(self.explain(elem)); [INFO] [stdout] 88 | | } else { [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/parser/explainer.rs:88:20 [INFO] [stdout] | [INFO] [stdout] 88 | } else { [INFO] [stdout] | ____________________^ [INFO] [stdout] 89 | | parts.push(self.explain(elem)); [INFO] [stdout] 90 | | } [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] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/test_generator.rs:173:21 [INFO] [stdout] | [INFO] [stdout] 173 | / if first == "def" || first == "function" { [INFO] [stdout] 174 | | if list.len() >= 3 { [INFO] [stdout] 175 | | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] ... | [INFO] [stdout] 185 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 173 ~ if (first == "def" || first == "function") { [INFO] [stdout] 174 ~ && list.len() >= 3 { [INFO] [stdout] 175 | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] ... [INFO] [stdout] 183 | } [INFO] [stdout] 184 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/evolution/test_generator.rs:332:37 [INFO] [stdout] | [INFO] [stdout] 332 | let statement_coverage = if test_cases.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!test_cases.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/tracker.rs:47:21 [INFO] [stdout] | [INFO] [stdout] 47 | / if new_rule.name.contains(&old_rule.name) [INFO] [stdout] 48 | | || old_rule.name.contains(&new_rule.name) [INFO] [stdout] 49 | | || new_rule.name == old_rule.name [INFO] [stdout] ... | [INFO] [stdout] 54 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 47 ~ if (new_rule.name.contains(&old_rule.name) [INFO] [stdout] 48 | || old_rule.name.contains(&new_rule.name) [INFO] [stdout] 49 ~ || new_rule.name == old_rule.name [INFO] [stdout] 50 ~ || new_rule.name == old_rule.name) [INFO] [stdout] 51 | { [INFO] [stdout] 52 ~ && !parents.contains(&prev_event.id) { [INFO] [stdout] 53 | parents.push(prev_event.id); [INFO] [stdout] 54 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/parser/nlu.rs:466:9 [INFO] [stdout] | [INFO] [stdout] 466 | if let Some(func_name) = self.extract_function_name(input).ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] = note: `#[warn(clippy::match_result_ok)]` on by default [INFO] [stdout] help: consider matching on `Ok(func_name)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 466 - if let Some(func_name) = self.extract_function_name(input).ok() { [INFO] [stdout] 466 + if let Ok(func_name) = self.extract_function_name(input) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/tracker.rs:61:21 [INFO] [stdout] | [INFO] [stdout] 61 | / if prev_new_rule.name == new_rule.name { [INFO] [stdout] 62 | | if !parents.contains(&prev_event.id) { [INFO] [stdout] 63 | | parents.push(prev_event.id); [INFO] [stdout] 64 | | } [INFO] [stdout] 65 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 61 ~ if prev_new_rule.name == new_rule.name [INFO] [stdout] 62 ~ && !parents.contains(&prev_event.id) { [INFO] [stdout] 63 | parents.push(prev_event.id); [INFO] [stdout] 64 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this manual char comparison can be written more succinctly [INFO] [stdout] --> src/parser/nlu.rs:497:20 [INFO] [stdout] | [INFO] [stdout] 497 | .split(|c: char| c == ',' || c == ',' || c == ' ' || c == '(' || c == ')') [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an array of `char`: `[',', ',', ' ', '(', ')']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison [INFO] [stdout] = note: `#[warn(clippy::manual_pattern_char_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `EvolutionGenealogy` [INFO] [stdout] --> src/evolution/tracker.rs:334:5 [INFO] [stdout] | [INFO] [stdout] 334 | / pub fn new() -> Self { [INFO] [stdout] 335 | | Self { [INFO] [stdout] 336 | | lineages: std::collections::HashMap::new(), [INFO] [stdout] 337 | | } [INFO] [stdout] 338 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 332 + impl Default for EvolutionGenealogy { [INFO] [stdout] 333 + fn default() -> Self { [INFO] [stdout] 334 + Self::new() [INFO] [stdout] 335 + } [INFO] [stdout] 336 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/evolution/tracker.rs:345:18 [INFO] [stdout] | [INFO] [stdout] 345 | .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] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/poetry/parser.rs:156:9 [INFO] [stdout] | [INFO] [stdout] 156 | imagery.sort_by(|a, b| b.frequency.cmp(&a.frequency)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 156 - imagery.sort_by(|a, b| b.frequency.cmp(&a.frequency)); [INFO] [stdout] 156 + imagery.sort_by_key(|b| std::cmp::Reverse(b.frequency)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `as_ref` does nothing [INFO] [stdout] --> src/python/bridge.rs:107:74 [INFO] [stdout] | [INFO] [stdout] 107 | let py_tuple = PyTuple::new_bound(py, py_args.iter().map(|a| a.as_ref())); [INFO] [stdout] | ^^^^^^^^^^ help: try: `a` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref [INFO] [stdout] = note: `#[warn(clippy::useless_asref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/python/bridge.rs:199:47 [INFO] [stdout] | [INFO] [stdout] 199 | PyValue::List(list.iter().map(|v| PyValue::from_evo_value(v)).collect()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `PyValue::from_evo_value` [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: parameter is only used in recursion [INFO] [stdout] --> src/python/bridge.rs:293:5 [INFO] [stdout] | [INFO] [stdout] 293 | py: Python<'py>, [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_py` [INFO] [stdout] | [INFO] [stdout] note: parameter used here [INFO] [stdout] --> src/python/bridge.rs:328:50 [INFO] [stdout] | [INFO] [stdout] 328 | list.push(pyobject_to_py_value_bound(py, &item)?); [INFO] [stdout] | ^^ [INFO] [stdout] ... [INFO] [stdout] 340 | dict.insert(key_str, pyobject_to_py_value_bound(py, &value)?); [INFO] [stdout] | ^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion [INFO] [stdout] = note: `#[warn(clippy::only_used_in_recursion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/runtime/interpreter.rs:21:22 [INFO] [stdout] | [INFO] [stdout] 21 | lambda_registry: HashMap, GrammarElement, HashMap)>, [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: unneeded `return` statement [INFO] [stdout] --> src/runtime/interpreter.rs:159:21 [INFO] [stdout] | [INFO] [stdout] 159 | / return Err(InterpreterError::runtime_error( [INFO] [stdout] 160 | | "Match expression parsing failed: should be handled at parse time" [INFO] [stdout] 161 | | .to_string(), [INFO] [stdout] 162 | | None, [INFO] [stdout] 163 | | )); [INFO] [stdout] | |______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 159 ~ Err(InterpreterError::runtime_error( [INFO] [stdout] 160 + "Match expression parsing failed: should be handled at parse time" [INFO] [stdout] 161 + .to_string(), [INFO] [stdout] 162 + None, [INFO] [stdout] 163 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/parser/adaptive.rs:57:16 [INFO] [stdout] | [INFO] [stdout] 57 | && !atom.parse::().is_ok() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `atom.parse::().is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/parser/adaptive.rs:58:16 [INFO] [stdout] | [INFO] [stdout] 58 | && !atom.parse::().is_ok() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `atom.parse::().is_err()` [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: name `EOF` contains a capitalized acronym [INFO] [stdout] --> src/parser/adaptive.rs:85:5 [INFO] [stdout] | [INFO] [stdout] 85 | EOF, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter (notice the capitalization): `Eof` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/parser/adaptive.rs:824:29 [INFO] [stdout] | [INFO] [stdout] 824 | / ... if !self.check(&Token::RightParen) { [INFO] [stdout] 825 | | ... // 后面还有元素,name 是变量名 [INFO] [stdout] 826 | | ... Some(name.clone()) [INFO] [stdout] 827 | | ... } else { [INFO] [stdout] ... | [INFO] [stdout] 833 | | ... }))); [INFO] [stdout] 834 | | ... } [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] 822 ~ GrammarElement::Atom(name) [INFO] [stdout] 823 | // 检查后面是否还有元素(不是右括号) [INFO] [stdout] 824 ~ if !self.check(&Token::RightParen) => { [INFO] [stdout] 825 | // 后面还有元素,name 是变量名 [INFO] [stdout] 826 | Some(name.clone()) [INFO] [stdout] 827 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/parser/context.rs:79:25 [INFO] [stdout] | [INFO] [stdout] 79 | / if let GrammarElement::Atom(name) = first { [INFO] [stdout] 80 | | // 存储函数定义 / Store function definition [INFO] [stdout] 81 | | self.functions.insert(name.clone(), intent.clone()); [INFO] [stdout] 82 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/parser/context.rs:78:33 [INFO] [stdout] | [INFO] [stdout] 78 | if let Some(first) = intent.code_structure.first() { [INFO] [stdout] | ^^^^^ replace this binding [INFO] [stdout] 79 | if let GrammarElement::Atom(name) = first { [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` has identical blocks [INFO] [stdout] --> src/parser/explainer.rs:86:23 [INFO] [stdout] | [INFO] [stdout] 86 | if i == 0 { [INFO] [stdout] | _______________________^ [INFO] [stdout] 87 | | parts.push(self.explain(elem)); [INFO] [stdout] 88 | | } else { [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/parser/explainer.rs:88:20 [INFO] [stdout] | [INFO] [stdout] 88 | } else { [INFO] [stdout] | ____________________^ [INFO] [stdout] 89 | | parts.push(self.explain(elem)); [INFO] [stdout] 90 | | } [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] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/parser/nlu.rs:466:9 [INFO] [stdout] | [INFO] [stdout] 466 | if let Some(func_name) = self.extract_function_name(input).ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] = note: `#[warn(clippy::match_result_ok)]` on by default [INFO] [stdout] help: consider matching on `Ok(func_name)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 466 - if let Some(func_name) = self.extract_function_name(input).ok() { [INFO] [stdout] 466 + if let Ok(func_name) = self.extract_function_name(input) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this manual char comparison can be written more succinctly [INFO] [stdout] --> src/parser/nlu.rs:497:20 [INFO] [stdout] | [INFO] [stdout] 497 | .split(|c: char| c == ',' || c == ',' || c == ' ' || c == '(' || c == ')') [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an array of `char`: `[',', ',', ' ', '(', ')']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison [INFO] [stdout] = note: `#[warn(clippy::manual_pattern_char_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/runtime/interpreter.rs:2212:21 [INFO] [stdout] | [INFO] [stdout] 2212 | / return Err(InterpreterError::type_error( [INFO] [stdout] 2213 | | "list-concat requires all lists or all strings".to_string(), [INFO] [stdout] 2214 | | None, [INFO] [stdout] 2215 | | )); [INFO] [stdout] | |______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 2212 ~ Err(InterpreterError::type_error( [INFO] [stdout] 2213 + "list-concat requires all lists or all strings".to_string(), [INFO] [stdout] 2214 + None, [INFO] [stdout] 2215 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/runtime/interpreter.rs:2678:20 [INFO] [stdout] | [INFO] [stdout] 2678 | if args.len() < 1 || args.len() > 2 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `args.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/poetry/parser.rs:156:9 [INFO] [stdout] | [INFO] [stdout] 156 | imagery.sort_by(|a, b| b.frequency.cmp(&a.frequency)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 156 - imagery.sort_by(|a, b| b.frequency.cmp(&a.frequency)); [INFO] [stdout] 156 + imagery.sort_by_key(|b| std::cmp::Reverse(b.frequency)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `as_ref` does nothing [INFO] [stdout] --> src/python/bridge.rs:107:74 [INFO] [stdout] | [INFO] [stdout] 107 | let py_tuple = PyTuple::new_bound(py, py_args.iter().map(|a| a.as_ref())); [INFO] [stdout] | ^^^^^^^^^^ help: try: `a` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref [INFO] [stdout] = note: `#[warn(clippy::useless_asref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/runtime/jit_interpreter.rs:86:9 [INFO] [stdout] | [INFO] [stdout] 86 | / if self.jit_compiler.is_hot_spot(&code_key) { [INFO] [stdout] 87 | | if self.jit_compiler.get_compiled_code(&code_key).is_none() { [INFO] [stdout] 88 | | if let Err(e) = self.jit_compiler.compile_hot_spot(&code_key, ast) { [INFO] [stdout] 89 | | eprintln!("JIT compilation failed: {:?}", e); [INFO] [stdout] ... | [INFO] [stdout] 92 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 86 ~ if self.jit_compiler.is_hot_spot(&code_key) [INFO] [stdout] 87 ~ && self.jit_compiler.get_compiled_code(&code_key).is_none() { [INFO] [stdout] 88 | if let Err(e) = self.jit_compiler.compile_hot_spot(&code_key, ast) { [INFO] [stdout] 89 | eprintln!("JIT compilation failed: {:?}", e); [INFO] [stdout] 90 | } [INFO] [stdout] 91 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/python/bridge.rs:199:47 [INFO] [stdout] | [INFO] [stdout] 199 | PyValue::List(list.iter().map(|v| PyValue::from_evo_value(v)).collect()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `PyValue::from_evo_value` [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: parameter is only used in recursion [INFO] [stdout] --> src/python/bridge.rs:293:5 [INFO] [stdout] | [INFO] [stdout] 293 | py: Python<'py>, [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_py` [INFO] [stdout] | [INFO] [stdout] note: parameter used here [INFO] [stdout] --> src/python/bridge.rs:328:50 [INFO] [stdout] | [INFO] [stdout] 328 | list.push(pyobject_to_py_value_bound(py, &item)?); [INFO] [stdout] | ^^ [INFO] [stdout] ... [INFO] [stdout] 340 | dict.insert(key_str, pyobject_to_py_value_bound(py, &value)?); [INFO] [stdout] | ^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion [INFO] [stdout] = note: `#[warn(clippy::only_used_in_recursion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/runtime/interpreter.rs:21:22 [INFO] [stdout] | [INFO] [stdout] 21 | lambda_registry: HashMap, GrammarElement, HashMap)>, [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: unneeded `return` statement [INFO] [stdout] --> src/runtime/interpreter.rs:159:21 [INFO] [stdout] | [INFO] [stdout] 159 | / return Err(InterpreterError::runtime_error( [INFO] [stdout] 160 | | "Match expression parsing failed: should be handled at parse time" [INFO] [stdout] 161 | | .to_string(), [INFO] [stdout] 162 | | None, [INFO] [stdout] 163 | | )); [INFO] [stdout] | |______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 159 ~ Err(InterpreterError::runtime_error( [INFO] [stdout] 160 + "Match expression parsing failed: should be handled at parse time" [INFO] [stdout] 161 + .to_string(), [INFO] [stdout] 162 + None, [INFO] [stdout] 163 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/runtime/mode.rs:105:1 [INFO] [stdout] | [INFO] [stdout] 105 | / impl Default for ExecutionMetrics { [INFO] [stdout] 106 | | fn default() -> Self { [INFO] [stdout] 107 | | Self { [INFO] [stdout] 108 | | optimization_opportunities: 0, [INFO] [stdout] ... | [INFO] [stdout] 112 | | } [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] 98 + #[derive(Default)] [INFO] [stdout] 99 | pub struct ExecutionMetrics { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `pyo3::PyErr` [INFO] [stdout] --> src/lib.rs:52:58 [INFO] [stdout] | [INFO] [stdout] 52 | fn execute(&mut self, code: &str) -> PyResult { [INFO] [stdout] | ^ [INFO] [stdout] | | [INFO] [stdout] | help: consider removing [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `pyo3::PyErr` [INFO] [stdout] --> src/lib.rs:64:57 [INFO] [stdout] | [INFO] [stdout] 64 | fn eval(&mut self, code: &str) -> PyResult { [INFO] [stdout] | ^ [INFO] [stdout] | | [INFO] [stdout] | help: consider removing [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `pyo3::PyErr` [INFO] [stdout] --> src/lib.rs:94:54 [INFO] [stdout] | [INFO] [stdout] 94 | fn parse(&self, code: &str) -> PyResult { [INFO] [stdout] | ^ [INFO] [stdout] | | [INFO] [stdout] | help: consider removing [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `pyo3::PyErr` [INFO] [stdout] --> src/lib.rs:105:43 [INFO] [stdout] | [INFO] [stdout] 105 | fn parse(code: &str) -> PyResult { [INFO] [stdout] | ^ [INFO] [stdout] | | [INFO] [stdout] | help: consider removing [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `pyo3::PyErr` [INFO] [stdout] --> src/lib.rs:116:43 [INFO] [stdout] | [INFO] [stdout] 116 | fn execute(code: &str) -> PyResult { [INFO] [stdout] | ^ [INFO] [stdout] | | [INFO] [stdout] | help: consider removing [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `pyo3::PyErr` [INFO] [stdout] --> src/lib.rs:131:42 [INFO] [stdout] | [INFO] [stdout] 131 | fn eval(code: &str) -> PyResult { [INFO] [stdout] | ^ [INFO] [stdout] | | [INFO] [stdout] | help: consider removing [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/runtime/interpreter.rs:2212:21 [INFO] [stdout] | [INFO] [stdout] 2212 | / return Err(InterpreterError::type_error( [INFO] [stdout] 2213 | | "list-concat requires all lists or all strings".to_string(), [INFO] [stdout] 2214 | | None, [INFO] [stdout] 2215 | | )); [INFO] [stdout] | |______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 2212 ~ Err(InterpreterError::type_error( [INFO] [stdout] 2213 + "list-concat requires all lists or all strings".to_string(), [INFO] [stdout] 2214 + None, [INFO] [stdout] 2215 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/runtime/interpreter.rs:2678:20 [INFO] [stdout] | [INFO] [stdout] 2678 | if args.len() < 1 || args.len() > 2 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `args.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/runtime/jit_interpreter.rs:86:9 [INFO] [stdout] | [INFO] [stdout] 86 | / if self.jit_compiler.is_hot_spot(&code_key) { [INFO] [stdout] 87 | | if self.jit_compiler.get_compiled_code(&code_key).is_none() { [INFO] [stdout] 88 | | if let Err(e) = self.jit_compiler.compile_hot_spot(&code_key, ast) { [INFO] [stdout] 89 | | eprintln!("JIT compilation failed: {:?}", e); [INFO] [stdout] ... | [INFO] [stdout] 92 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 86 ~ if self.jit_compiler.is_hot_spot(&code_key) [INFO] [stdout] 87 ~ && self.jit_compiler.get_compiled_code(&code_key).is_none() { [INFO] [stdout] 88 | if let Err(e) = self.jit_compiler.compile_hot_spot(&code_key, ast) { [INFO] [stdout] 89 | eprintln!("JIT compilation failed: {:?}", e); [INFO] [stdout] 90 | } [INFO] [stdout] 91 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/runtime/mode.rs:105:1 [INFO] [stdout] | [INFO] [stdout] 105 | / impl Default for ExecutionMetrics { [INFO] [stdout] 106 | | fn default() -> Self { [INFO] [stdout] 107 | | Self { [INFO] [stdout] 108 | | optimization_opportunities: 0, [INFO] [stdout] ... | [INFO] [stdout] 112 | | } [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] 98 + #[derive(Default)] [INFO] [stdout] 99 | pub struct ExecutionMetrics { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `pyo3::PyErr` [INFO] [stdout] --> src/lib.rs:52:58 [INFO] [stdout] | [INFO] [stdout] 52 | fn execute(&mut self, code: &str) -> PyResult { [INFO] [stdout] | ^ [INFO] [stdout] | | [INFO] [stdout] | help: consider removing [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `pyo3::PyErr` [INFO] [stdout] --> src/lib.rs:64:57 [INFO] [stdout] | [INFO] [stdout] 64 | fn eval(&mut self, code: &str) -> PyResult { [INFO] [stdout] | ^ [INFO] [stdout] | | [INFO] [stdout] | help: consider removing [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `pyo3::PyErr` [INFO] [stdout] --> src/lib.rs:94:54 [INFO] [stdout] | [INFO] [stdout] 94 | fn parse(&self, code: &str) -> PyResult { [INFO] [stdout] | ^ [INFO] [stdout] | | [INFO] [stdout] | help: consider removing [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `pyo3::PyErr` [INFO] [stdout] --> src/lib.rs:105:43 [INFO] [stdout] | [INFO] [stdout] 105 | fn parse(code: &str) -> PyResult { [INFO] [stdout] | ^ [INFO] [stdout] | | [INFO] [stdout] | help: consider removing [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `pyo3::PyErr` [INFO] [stdout] --> src/lib.rs:116:43 [INFO] [stdout] | [INFO] [stdout] 116 | fn execute(code: &str) -> PyResult { [INFO] [stdout] | ^ [INFO] [stdout] | | [INFO] [stdout] | help: consider removing [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `pyo3::PyErr` [INFO] [stdout] --> src/lib.rs:131:42 [INFO] [stdout] | [INFO] [stdout] 131 | fn eval(code: &str) -> PyResult { [INFO] [stdout] | ^ [INFO] [stdout] | | [INFO] [stdout] | help: consider removing [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `StateSnapshot` [INFO] [stdout] --> src/evolution/event_manager.rs:6:65 [INFO] [stdout] | [INFO] [stdout] 6 | use crate::evolution::tracker::{EvolutionDelta, EvolutionEvent, StateSnapshot}; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `crate::grammar::rule::GrammarRule` [INFO] [stdout] --> src/evolution/event_manager.rs:7:5 [INFO] [stdout] | [INFO] [stdout] 7 | use crate::grammar::rule::GrammarRule; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `crate::grammar::core::GrammarElement` [INFO] [stdout] --> src/evolution/quality_assessor.rs:6:5 [INFO] [stdout] | [INFO] [stdout] 6 | use crate::grammar::core::GrammarElement; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around block return value [INFO] [stdout] --> src/evolution/quality_assessor.rs:336:9 [INFO] [stdout] | [INFO] [stdout] 336 | (dimensions.readability * 0.25 [INFO] [stdout] | ^ [INFO] [stdout] ... [INFO] [stdout] 340 | + dimensions.simplicity * 0.15) [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 336 ~ dimensions.readability * 0.25 [INFO] [stdout] 337 | + dimensions.maintainability * 0.25 [INFO] [stdout] 338 | + dimensions.performance * 0.20 [INFO] [stdout] 339 | + dimensions.security * 0.15 [INFO] [stdout] 340 ~ + dimensions.simplicity * 0.15 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `event_manager::*` [INFO] [stdout] --> src/evolution/mod.rs:64:9 [INFO] [stdout] | [INFO] [stdout] 64 | pub use event_manager::*; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `knowledge::*` [INFO] [stdout] --> src/evolution/mod.rs:65:9 [INFO] [stdout] | [INFO] [stdout] 65 | pub use knowledge::*; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `learning::*` [INFO] [stdout] --> src/evolution/mod.rs:66:9 [INFO] [stdout] | [INFO] [stdout] 66 | pub use learning::*; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `tracker::*` [INFO] [stdout] --> src/evolution/mod.rs:72:9 [INFO] [stdout] | [INFO] [stdout] 72 | pub use tracker::*; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `core::*` [INFO] [stdout] --> src/grammar/mod.rs:22:9 [INFO] [stdout] | [INFO] [stdout] 22 | pub use core::*; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `rule::*` [INFO] [stdout] --> src/grammar/mod.rs:23:9 [INFO] [stdout] | [INFO] [stdout] 23 | pub use rule::*; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `ProgrammingIntent` [INFO] [stdout] --> src/parser/context.rs:6:40 [INFO] [stdout] | [INFO] [stdout] 6 | use crate::parser::nlu::{ParsedIntent, ProgrammingIntent}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Emotion` [INFO] [stdout] --> src/poetry/parser.rs:5:30 [INFO] [stdout] | [INFO] [stdout] 5 | use crate::poetry::emotion::{Emotion, EmotionAnalysis}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `emotion::*` [INFO] [stdout] --> src/poetry/mod.rs:8:9 [INFO] [stdout] | [INFO] [stdout] 8 | pub use emotion::*; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `bridge::*` [INFO] [stdout] --> src/python/mod.rs:7:9 [INFO] [stdout] | [INFO] [stdout] 7 | pub use bridge::*; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Instant` [INFO] [stdout] --> src/runtime/jit.rs:9:27 [INFO] [stdout] | [INFO] [stdout] 9 | use std::time::{Duration, Instant}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Duration` [INFO] [stdout] --> src/runtime/jit_interpreter.rs:8:17 [INFO] [stdout] | [INFO] [stdout] 8 | use std::time::{Duration, Instant}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `jit::*` [INFO] [stdout] --> src/runtime/mod.rs:32:9 [INFO] [stdout] | [INFO] [stdout] 32 | pub use jit::*; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `mode::*` [INFO] [stdout] --> src/runtime/mod.rs:34:9 [INFO] [stdout] | [INFO] [stdout] 34 | pub use mode::*; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `StateSnapshot` [INFO] [stdout] --> src/evolution/event_manager.rs:6:65 [INFO] [stdout] | [INFO] [stdout] 6 | use crate::evolution::tracker::{EvolutionDelta, EvolutionEvent, StateSnapshot}; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `crate::grammar::rule::GrammarRule` [INFO] [stdout] --> src/evolution/event_manager.rs:7:5 [INFO] [stdout] | [INFO] [stdout] 7 | use crate::grammar::rule::GrammarRule; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `crate::grammar::core::GrammarElement` [INFO] [stdout] --> src/evolution/quality_assessor.rs:6:5 [INFO] [stdout] | [INFO] [stdout] 6 | use crate::grammar::core::GrammarElement; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around block return value [INFO] [stdout] --> src/evolution/quality_assessor.rs:336:9 [INFO] [stdout] | [INFO] [stdout] 336 | (dimensions.readability * 0.25 [INFO] [stdout] | ^ [INFO] [stdout] ... [INFO] [stdout] 340 | + dimensions.simplicity * 0.15) [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 336 ~ dimensions.readability * 0.25 [INFO] [stdout] 337 | + dimensions.maintainability * 0.25 [INFO] [stdout] 338 | + dimensions.performance * 0.20 [INFO] [stdout] 339 | + dimensions.security * 0.15 [INFO] [stdout] 340 ~ + dimensions.simplicity * 0.15 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `event_manager::*` [INFO] [stdout] --> src/evolution/mod.rs:64:9 [INFO] [stdout] | [INFO] [stdout] 64 | pub use event_manager::*; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `knowledge::*` [INFO] [stdout] --> src/evolution/mod.rs:65:9 [INFO] [stdout] | [INFO] [stdout] 65 | pub use knowledge::*; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `learning::*` [INFO] [stdout] --> src/evolution/mod.rs:66:9 [INFO] [stdout] | [INFO] [stdout] 66 | pub use learning::*; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `tracker::*` [INFO] [stdout] --> src/evolution/mod.rs:72:9 [INFO] [stdout] | [INFO] [stdout] 72 | pub use tracker::*; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `core::*` [INFO] [stdout] --> src/grammar/mod.rs:22:9 [INFO] [stdout] | [INFO] [stdout] 22 | pub use core::*; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `rule::*` [INFO] [stdout] --> src/grammar/mod.rs:23:9 [INFO] [stdout] | [INFO] [stdout] 23 | pub use rule::*; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `ProgrammingIntent` [INFO] [stdout] --> src/parser/context.rs:6:40 [INFO] [stdout] | [INFO] [stdout] 6 | use crate::parser::nlu::{ParsedIntent, ProgrammingIntent}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Emotion` [INFO] [stdout] --> src/poetry/parser.rs:5:30 [INFO] [stdout] | [INFO] [stdout] 5 | use crate::poetry::emotion::{Emotion, EmotionAnalysis}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `emotion::*` [INFO] [stdout] --> src/poetry/mod.rs:8:9 [INFO] [stdout] | [INFO] [stdout] 8 | pub use emotion::*; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `bridge::*` [INFO] [stdout] --> src/python/mod.rs:7:9 [INFO] [stdout] | [INFO] [stdout] 7 | pub use bridge::*; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Instant` [INFO] [stdout] --> src/runtime/jit.rs:9:27 [INFO] [stdout] | [INFO] [stdout] 9 | use std::time::{Duration, Instant}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Duration` [INFO] [stdout] --> src/runtime/jit_interpreter.rs:8:17 [INFO] [stdout] | [INFO] [stdout] 8 | use std::time::{Duration, Instant}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `jit::*` [INFO] [stdout] --> src/runtime/mod.rs:32:9 [INFO] [stdout] | [INFO] [stdout] 32 | pub use jit::*; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `mode::*` [INFO] [stdout] --> src/runtime/mod.rs:34:9 [INFO] [stdout] | [INFO] [stdout] 34 | pub use mode::*; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/evolution/analyzer.rs:111:13 [INFO] [stdout] | [INFO] [stdout] 111 | let mut statistics = self.collect_statistics(ast); [INFO] [stdout] | ----^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/analyzer.rs:301:9 [INFO] [stdout] | [INFO] [stdout] 301 | ast: &[GrammarElement], [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/analyzer.rs:343:36 [INFO] [stdout] | [INFO] [stdout] 343 | fn calculate_complexity(&self, ast: &[GrammarElement], stats: &CodeStatistics) -> f64 { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/evolution/analyzer.rs:111:13 [INFO] [stdout] | [INFO] [stdout] 111 | let mut statistics = self.collect_statistics(ast); [INFO] [stdout] | ----^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/analyzer.rs:301:9 [INFO] [stdout] | [INFO] [stdout] 301 | ast: &[GrammarElement], [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/analyzer.rs:343:36 [INFO] [stdout] | [INFO] [stdout] 343 | fn calculate_complexity(&self, ast: &[GrammarElement], stats: &CodeStatistics) -> f64 { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/code_reviewer.rs:220:9 [INFO] [stdout] | [INFO] [stdout] 220 | ast: &[GrammarElement], [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `analysis` [INFO] [stdout] --> src/evolution/dependency.rs:133:9 [INFO] [stdout] | [INFO] [stdout] 133 | analysis: &CodeAnalysis, [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_analysis` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/evolution/doc_generator.rs:186:13 [INFO] [stdout] | [INFO] [stdout] 186 | let mut example_count = 0; [INFO] [stdout] | ----^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `template_key` [INFO] [stdout] --> src/evolution/doc_generator.rs:189:13 [INFO] [stdout] | [INFO] [stdout] 189 | let template_key = match format { [INFO] [stdout] | ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_template_key` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `content` is never read [INFO] [stdout] --> src/evolution/doc_generator.rs:183:27 [INFO] [stdout] | [INFO] [stdout] 183 | let mut content = String::new(); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `analysis` [INFO] [stdout] --> src/evolution/doc_generator.rs:309:56 [INFO] [stdout] | [INFO] [stdout] 309 | fn generate_api_doc(&self, ast: &[GrammarElement], analysis: &CodeAnalysis) -> String { [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_analysis` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `analysis` [INFO] [stdout] --> src/evolution/doc_generator.rs:332:58 [INFO] [stdout] | [INFO] [stdout] 332 | fn generate_plain_doc(&self, ast: &[GrammarElement], analysis: &CodeAnalysis) -> String { [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_analysis` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/code_reviewer.rs:220:9 [INFO] [stdout] | [INFO] [stdout] 220 | ast: &[GrammarElement], [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `analysis` [INFO] [stdout] --> src/evolution/dependency.rs:133:9 [INFO] [stdout] | [INFO] [stdout] 133 | analysis: &CodeAnalysis, [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_analysis` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/evolution/doc_generator.rs:186:13 [INFO] [stdout] | [INFO] [stdout] 186 | let mut example_count = 0; [INFO] [stdout] | ----^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `template_key` [INFO] [stdout] --> src/evolution/doc_generator.rs:189:13 [INFO] [stdout] | [INFO] [stdout] 189 | let template_key = match format { [INFO] [stdout] | ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_template_key` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `content` is never read [INFO] [stdout] --> src/evolution/doc_generator.rs:183:27 [INFO] [stdout] | [INFO] [stdout] 183 | let mut content = String::new(); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `analysis` [INFO] [stdout] --> src/evolution/doc_generator.rs:309:56 [INFO] [stdout] | [INFO] [stdout] 309 | fn generate_api_doc(&self, ast: &[GrammarElement], analysis: &CodeAnalysis) -> String { [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_analysis` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `analysis` [INFO] [stdout] --> src/evolution/doc_generator.rs:332:58 [INFO] [stdout] | [INFO] [stdout] 332 | fn generate_plain_doc(&self, ast: &[GrammarElement], analysis: &CodeAnalysis) -> String { [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_analysis` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `node` [INFO] [stdout] --> src/evolution/knowledge.rs:359:17 [INFO] [stdout] | [INFO] [stdout] 359 | let node = self.graph.entry(entity.clone()).or_insert_with(|| { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_node` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `node` [INFO] [stdout] --> src/evolution/knowledge.rs:359:17 [INFO] [stdout] | [INFO] [stdout] 359 | let node = self.graph.entry(entity.clone()).or_insert_with(|| { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_node` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/performance.rs:260:39 [INFO] [stdout] | [INFO] [stdout] 260 | fn analyze_time_complexity(&self, ast: &[GrammarElement], analysis: &CodeAnalysis) -> String { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/performance.rs:276:40 [INFO] [stdout] | [INFO] [stdout] 276 | fn analyze_space_complexity(&self, ast: &[GrammarElement], analysis: &CodeAnalysis) -> String { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/performance.rs:289:39 [INFO] [stdout] | [INFO] [stdout] 289 | fn estimate_execution_time(&self, ast: &[GrammarElement], analysis: &CodeAnalysis) -> f64 { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/performance.rs:298:37 [INFO] [stdout] | [INFO] [stdout] 298 | fn estimate_memory_usage(&self, ast: &[GrammarElement], analysis: &CodeAnalysis) -> f64 { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/performance.rs:323:9 [INFO] [stdout] | [INFO] [stdout] 323 | ast: &[GrammarElement], [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/performance.rs:260:39 [INFO] [stdout] | [INFO] [stdout] 260 | fn analyze_time_complexity(&self, ast: &[GrammarElement], analysis: &CodeAnalysis) -> String { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/performance.rs:276:40 [INFO] [stdout] | [INFO] [stdout] 276 | fn analyze_space_complexity(&self, ast: &[GrammarElement], analysis: &CodeAnalysis) -> String { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/performance.rs:289:39 [INFO] [stdout] | [INFO] [stdout] 289 | fn estimate_execution_time(&self, ast: &[GrammarElement], analysis: &CodeAnalysis) -> f64 { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/performance.rs:298:37 [INFO] [stdout] | [INFO] [stdout] 298 | fn estimate_memory_usage(&self, ast: &[GrammarElement], analysis: &CodeAnalysis) -> f64 { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ast` [INFO] [stdout] --> src/evolution/performance.rs:323:9 [INFO] [stdout] | [INFO] [stdout] 323 | ast: &[GrammarElement], [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ast` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:374:17 [INFO] [stdout] | [INFO] [stdout] 374 | let mut engine = EvolutionEngine::new(); [INFO] [stdout] | ----^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `parser` [INFO] [stdout] --> src/main.rs:1452:9 [INFO] [stdout] | [INFO] [stdout] 1452 | let parser = AdaptiveParser::new(true); [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_parser` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:374:17 [INFO] [stdout] | [INFO] [stdout] 374 | let mut engine = EvolutionEngine::new(); [INFO] [stdout] | ----^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `parser` [INFO] [stdout] --> src/main.rs:1452:9 [INFO] [stdout] | [INFO] [stdout] 1452 | let parser = AdaptiveParser::new(true); [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_parser` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `update_template_stats` is never used [INFO] [stdout] --> src/evolution/code_generator.rs:307:12 [INFO] [stdout] | [INFO] [stdout] 60 | impl IntelligentCodeGenerator { [INFO] [stdout] | ----------------------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 307 | pub fn update_template_stats(&mut self, template_name: &str, success: bool) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `nlu_parser` is never read [INFO] [stdout] --> src/evolution/engine.rs:25:5 [INFO] [stdout] | [INFO] [stdout] 17 | pub struct EvolutionEngine { [INFO] [stdout] | --------------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 25 | nlu_parser: NLUParser, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: multiple associated items are never used [INFO] [stdout] --> src/evolution/engine.rs:61:12 [INFO] [stdout] | [INFO] [stdout] 34 | impl EvolutionEngine { [INFO] [stdout] | -------------------- associated items in this implementation [INFO] [stdout] ... [INFO] [stdout] 61 | pub fn evolve_from_natural_language( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 84 | fn generate_syntax_variants( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 98 | fn test_variants(&self, variants: Vec) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 108 | fn integrate_new_feature(&mut self, rule: GrammarRule) -> Result<(), EvolutionError> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 447 | pub fn rollback_to_event(&mut self, event_id: uuid::Uuid) -> Result<(), EvolutionError> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 474 | pub fn load_events_from_dir( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 875 | fn load_enhanced_bootstrap_rules() -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 891 | pub fn load_self_hosting_tools(&self) -> Result, EvolutionError> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 911 | pub fn validate_self_hosting_module(&self) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 921 | fn execute_evo_code(&self, code: &str) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 933 | fn intent_to_evo_dict(&self, intent: &crate::parser::nlu::ProgrammingIntent) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 949 | fn string_to_evo(&self, input: &str) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 954 | fn list_to_evo(&self, items: &[String]) -> String { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 959 | fn pairs_to_evo(&self, pairs: &[(String, String)]) -> String { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 967 | fn rules_from_value(&self, value: &Value) -> Result, EvolutionError> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `NLUError`, `NoVariants`, and `TestFailed` are never constructed [INFO] [stdout] --> src/evolution/engine.rs:1070:5 [INFO] [stdout] | [INFO] [stdout] 1068 | pub enum EvolutionError { [INFO] [stdout] | -------------- variants in this enum [INFO] [stdout] 1069 | /// NLU错误 / NLU error [INFO] [stdout] 1070 | NLUError(String), [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 1071 | /// 无变体 / No variants [INFO] [stdout] 1072 | NoVariants, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] 1073 | /// 测试失败 / Test failed [INFO] [stdout] 1074 | TestFailed(String), [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `EvolutionError` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: multiple methods are never used [INFO] [stdout] --> src/evolution/event_manager.rs:47:12 [INFO] [stdout] | [INFO] [stdout] 19 | impl EvolutionEventManager { [INFO] [stdout] | -------------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 47 | pub fn load_event(&self, event_id: Uuid) -> Result { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 62 | pub fn load_all_events(&self) -> Result, EventManagerError> { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 94 | pub fn validate_event(&self, event: &EvolutionEvent) -> Result<(), EventValidationError> { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 124 | pub fn detect_conflicts(&self, events: &[EvolutionEvent]) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 139 | fn check_event_conflict( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 187 | pub fn merge_events( [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 260 | fn select_best_event( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 281 | fn calculate_event_score(&self, event: &EvolutionEvent) -> f64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 292 | fn merge_metrics( [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `DeserializationError`, `EmptyEventList`, and `ValidationError` are never constructed [INFO] [stdout] --> src/evolution/event_manager.rs:332:5 [INFO] [stdout] | [INFO] [stdout] 329 | pub enum EventManagerError { [INFO] [stdout] | ----------------- variants in this enum [INFO] [stdout] ... [INFO] [stdout] 332 | DeserializationError(serde_json::Error), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 333 | EmptyEventList, [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] 334 | ValidationError(EventValidationError), [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `EventManagerError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `InvalidId`, `InvalidState`, `EmptyDelta`, and `InvalidRule` are never constructed [INFO] [stdout] --> src/evolution/event_manager.rs:354:5 [INFO] [stdout] | [INFO] [stdout] 353 | pub enum EventValidationError { [INFO] [stdout] | -------------------- variants in this enum [INFO] [stdout] 354 | InvalidId, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] 355 | InvalidState, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] 356 | EmptyDelta, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] 357 | InvalidRule, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `EventValidationError` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `EventConflict` is never constructed [INFO] [stdout] --> src/evolution/event_manager.rs:362:12 [INFO] [stdout] | [INFO] [stdout] 362 | pub struct EventConflict { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `ConflictType` is never used [INFO] [stdout] --> src/evolution/event_manager.rs:371:10 [INFO] [stdout] | [INFO] [stdout] 371 | pub enum ConflictType { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `mine` is never used [INFO] [stdout] --> src/evolution/knowledge.rs:484:12 [INFO] [stdout] | [INFO] [stdout] 475 | impl PatternMiner { [INFO] [stdout] | ----------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 484 | pub fn mine(&mut self, events: &[EvolutionEvent]) -> Vec { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `set_threshold` is never used [INFO] [stdout] --> src/evolution/similarity.rs:111:12 [INFO] [stdout] | [INFO] [stdout] 101 | impl SimilarityDetector { [INFO] [stdout] | ----------------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 111 | pub fn set_threshold(&mut self, threshold: f64) { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `record_test_results` is never used [INFO] [stdout] --> src/evolution/test_generator.rs:353:12 [INFO] [stdout] | [INFO] [stdout] 115 | impl TestGenerator { [INFO] [stdout] | ------------------ method in this implementation [INFO] [stdout] ... [INFO] [stdout] 353 | pub fn record_test_results(&mut self, passed: usize, failed: usize) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `rollback_to` and `load_events_from_dir` are never used [INFO] [stdout] --> src/evolution/tracker.rs:92:12 [INFO] [stdout] | [INFO] [stdout] 18 | impl EvolutionTracker { [INFO] [stdout] | --------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 92 | pub fn rollback_to(&mut self, event_id: Uuid) -> Result { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 192 | pub fn load_events_from_dir( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `remove_event_and_descendants` is never used [INFO] [stdout] --> src/evolution/tracker.rs:356:12 [INFO] [stdout] | [INFO] [stdout] 332 | impl EvolutionGenealogy { [INFO] [stdout] | ----------------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 356 | pub fn remove_event_and_descendants(&mut self, event_id: Uuid) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `DEF` is never used [INFO] [stdout] --> src/grammar/core.rs:138:15 [INFO] [stdout] | [INFO] [stdout] 138 | pub const DEF: &str = "def"; [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `LET` is never used [INFO] [stdout] --> src/grammar/core.rs:139:15 [INFO] [stdout] | [INFO] [stdout] 139 | pub const LET: &str = "let"; [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `IF` is never used [INFO] [stdout] --> src/grammar/core.rs:140:15 [INFO] [stdout] | [INFO] [stdout] 140 | pub const IF: &str = "if"; [INFO] [stdout] | ^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `THEN` is never used [INFO] [stdout] --> src/grammar/core.rs:141:15 [INFO] [stdout] | [INFO] [stdout] 141 | pub const THEN: &str = "then"; [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `ELSE` is never used [INFO] [stdout] --> src/grammar/core.rs:142:15 [INFO] [stdout] | [INFO] [stdout] 142 | pub const ELSE: &str = "else"; [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `FUNCTION` is never used [INFO] [stdout] --> src/grammar/core.rs:143:15 [INFO] [stdout] | [INFO] [stdout] 143 | pub const FUNCTION: &str = "function"; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `RETURN` is never used [INFO] [stdout] --> src/grammar/core.rs:144:15 [INFO] [stdout] | [INFO] [stdout] 144 | pub const RETURN: &str = "return"; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `update` and `matches` are never used [INFO] [stdout] --> src/grammar/rule.rs:149:12 [INFO] [stdout] | [INFO] [stdout] 133 | impl GrammarRule { [INFO] [stdout] | ---------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 149 | pub fn update(&mut self, pattern: Pattern, production: Production, meta: RuleMetadata) { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 157 | pub fn matches(&self, _input: &[GrammarElement]) -> bool { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `recursive` is never used [INFO] [stdout] --> src/grammar/self_desc.rs:32:12 [INFO] [stdout] | [INFO] [stdout] 21 | impl SelfDescribingRule { [INFO] [stdout] | ----------------------- associated function in this implementation [INFO] [stdout] ... [INFO] [stdout] 32 | pub fn recursive( [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `rules` and `allow_experimental` are never read [INFO] [stdout] --> src/parser/adaptive.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 9 | pub struct AdaptiveParser { [INFO] [stdout] | -------------- fields in this struct [INFO] [stdout] 10 | /// 语法规则列表 / List of grammar rules [INFO] [stdout] 11 | rules: Vec, [INFO] [stdout] | ^^^^^ [INFO] [stdout] 12 | /// 是否允许实验性语法 / Whether experimental syntax is allowed [INFO] [stdout] 13 | allow_experimental: bool, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `add_rule`, `found_unknown_syntax`, `is_unknown_keyword`, and `propose_syntax_expansion` are never used [INFO] [stdout] --> src/parser/adaptive.rs:26:12 [INFO] [stdout] | [INFO] [stdout] 16 | impl AdaptiveParser { [INFO] [stdout] | ------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 26 | pub fn add_rule(&mut self, rule: GrammarRule) { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 39 | pub fn found_unknown_syntax(&self, ast: &[GrammarElement]) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 53 | fn is_unknown_keyword(&self, atom: &str) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 62 | pub fn propose_syntax_expansion(&self, _ast: &[GrammarElement]) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `NotImplemented`, `UnknownSyntax`, and `RuleConflict` are never constructed [INFO] [stdout] --> src/parser/adaptive.rs:1332:5 [INFO] [stdout] | [INFO] [stdout] 1330 | pub enum ParseError { [INFO] [stdout] | ---------- variants in this enum [INFO] [stdout] 1331 | /// 未实现 / Not implemented [INFO] [stdout] 1332 | NotImplemented, [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 1339 | UnknownSyntax { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 1344 | RuleConflict { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `unknown_syntax`, `message`, and `location` are never used [INFO] [stdout] --> src/parser/adaptive.rs:1357:12 [INFO] [stdout] | [INFO] [stdout] 1350 | impl ParseError { [INFO] [stdout] | --------------- associated items in this implementation [INFO] [stdout] ... [INFO] [stdout] 1357 | pub fn unknown_syntax(message: String, location: Option) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 1362 | pub fn message(&self) -> &str { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 1372 | pub fn location(&self) -> Option { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `session_id` is never read [INFO] [stdout] --> src/parser/context.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 11 | pub struct ContextManager { [INFO] [stdout] | -------------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 19 | session_id: String, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `get_context`, `clear`, and `update_execution_result` are never used [INFO] [stdout] --> src/parser/context.rs:93:12 [INFO] [stdout] | [INFO] [stdout] 39 | impl ContextManager { [INFO] [stdout] | ------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 93 | pub fn get_context(&self, lookback: usize) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 293 | pub fn clear(&mut self) { [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 300 | pub fn update_execution_result(&mut self, turn_id: usize, result: String) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `ReferenceNotFound` and `ParseError` are never constructed [INFO] [stdout] --> src/parser/context.rs:348:5 [INFO] [stdout] | [INFO] [stdout] 346 | pub enum ContextError { [INFO] [stdout] | ------------ variants in this enum [INFO] [stdout] 347 | /// 未找到引用 / Reference not found [INFO] [stdout] 348 | ReferenceNotFound(String), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] 349 | /// 解析错误 / Parse error [INFO] [stdout] 350 | ParseError(String), [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `ContextError` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `model_type` and `use_local` are never read [INFO] [stdout] --> src/parser/nlu.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 10 | pub struct NLUParser { [INFO] [stdout] | --------- fields in this struct [INFO] [stdout] 11 | /// 使用的模型类型 / Model type used [INFO] [stdout] 12 | model_type: ModelType, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] 13 | /// 是否使用本地模型 / Whether to use local model [INFO] [stdout] 14 | use_local: bool, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `number_patterns` is never read [INFO] [stdout] --> src/parser/nlu.rs:43:5 [INFO] [stdout] | [INFO] [stdout] 35 | struct RuleDatabase { [INFO] [stdout] | ------------ field in this struct [INFO] [stdout] ... [INFO] [stdout] 43 | number_patterns: Vec<&'static str>, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `NotImplemented`, `ModelError`, and `AmbiguousIntent` are never constructed [INFO] [stdout] --> src/parser/nlu.rs:1067:5 [INFO] [stdout] | [INFO] [stdout] 1065 | pub enum NLUError { [INFO] [stdout] | -------- variants in this enum [INFO] [stdout] 1066 | /// 未实现 / Not implemented [INFO] [stdout] 1067 | NotImplemented, [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] 1068 | /// 模型错误 / Model error [INFO] [stdout] 1069 | ModelError(String), [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] 1070 | /// 意图不明确 / Ambiguous intent [INFO] [stdout] 1071 | AmbiguousIntent(String), [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `NLUError` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant `AnalysisError` is never constructed [INFO] [stdout] --> src/poetry/emotion.rs:166:5 [INFO] [stdout] | [INFO] [stdout] 164 | pub enum EmotionError { [INFO] [stdout] | ------------ variant in this enum [INFO] [stdout] 165 | /// 分析错误 / Analysis error [INFO] [stdout] 166 | AnalysisError(String), [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `EmotionError` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant `ParseError` is never constructed [INFO] [stdout] --> src/poetry/parser.rs:216:5 [INFO] [stdout] | [INFO] [stdout] 214 | pub enum PoetryError { [INFO] [stdout] | ----------- variant in this enum [INFO] [stdout] 215 | /// 解析错误 / Parse error [INFO] [stdout] 216 | ParseError(String), [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `PoetryError` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `PyBridge` is never constructed [INFO] [stdout] --> src/python/bridge.rs:11:12 [INFO] [stdout] | [INFO] [stdout] 11 | pub struct PyBridge { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `new`, `initialize`, `import_module`, `call_function`, `execute_code`, and `eval` are never used [INFO] [stdout] --> src/python/bridge.rs:18:12 [INFO] [stdout] | [INFO] [stdout] 16 | impl PyBridge { [INFO] [stdout] | ------------- associated items in this implementation [INFO] [stdout] 17 | /// 创建新桥接器 / Create new bridge [INFO] [stdout] 18 | pub fn new() -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 23 | pub fn initialize(&mut self) -> Result<(), PyBridgeError> { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 35 | pub fn import_module(&self, module_name: &str) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 79 | pub fn call_function( [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 118 | pub fn execute_code(&self, code: &str) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 137 | pub fn eval(&self, expression: &str) -> Result { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `PyModuleInfo` is never constructed [INFO] [stdout] --> src/python/bridge.rs:160:12 [INFO] [stdout] | [INFO] [stdout] 160 | pub struct PyModuleInfo { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `PyValue` is never used [INFO] [stdout] --> src/python/bridge.rs:169:10 [INFO] [stdout] | [INFO] [stdout] 169 | pub enum PyValue { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `from_evo_value` and `to_evo_value` are never used [INFO] [stdout] --> src/python/bridge.rs:188:12 [INFO] [stdout] | [INFO] [stdout] 186 | impl PyValue { [INFO] [stdout] | ------------ associated items in this implementation [INFO] [stdout] 187 | /// 从Evo-lang Value转换 / Convert from Evo-lang Value [INFO] [stdout] 188 | pub fn from_evo_value(value: &crate::runtime::interpreter::Value) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 210 | pub fn to_evo_value(&self) -> crate::runtime::interpreter::Value { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `PyBridgeError` is never used [INFO] [stdout] --> src/python/bridge.rs:231:10 [INFO] [stdout] | [INFO] [stdout] 231 | pub enum PyBridgeError { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `py_value_to_pyobject_bound` is never used [INFO] [stdout] --> src/python/bridge.rs:262:4 [INFO] [stdout] | [INFO] [stdout] 262 | fn py_value_to_pyobject_bound<'py>( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `pyobject_to_py_value_bound` is never used [INFO] [stdout] --> src/python/bridge.rs:292:4 [INFO] [stdout] | [INFO] [stdout] 292 | fn pyobject_to_py_value_bound<'py>( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `captured_env` is never read [INFO] [stdout] --> src/runtime/interpreter.rs:37:5 [INFO] [stdout] | [INFO] [stdout] 31 | struct Function { [INFO] [stdout] | -------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 37 | captured_env: Option>, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Function` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `eval_expr_list` and `call_user_function` are never used [INFO] [stdout] --> src/runtime/interpreter.rs:119:8 [INFO] [stdout] | [INFO] [stdout] 53 | impl Interpreter { [INFO] [stdout] | ---------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 119 | fn eval_expr_list(&mut self, exprs: &[Expr]) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 2014 | fn call_user_function( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/runtime/interpreter.rs:3077:12 [INFO] [stdout] | [INFO] [stdout] 3076 | impl Location { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3077 | pub fn new(line: usize, column: usize) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant `NotImplemented` is never constructed [INFO] [stdout] --> src/runtime/interpreter.rs:3090:5 [INFO] [stdout] | [INFO] [stdout] 3088 | pub enum InterpreterError { [INFO] [stdout] | ---------------- variant in this enum [INFO] [stdout] 3089 | /// 未实现 / Not implemented [INFO] [stdout] 3090 | NotImplemented, [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `InterpreterError` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `compiled_at_timestamp` is never read [INFO] [stdout] --> src/runtime/jit.rs:31:5 [INFO] [stdout] | [INFO] [stdout] 25 | pub struct CompiledCode { [INFO] [stdout] | ------------ field in this struct [INFO] [stdout] ... [INFO] [stdout] 31 | compiled_at_timestamp: u64, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `CompiledCode` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `set_enabled` and `clear_cache` are never used [INFO] [stdout] --> src/runtime/jit.rs:71:12 [INFO] [stdout] | [INFO] [stdout] 49 | impl JITCompiler { [INFO] [stdout] | ---------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 71 | pub fn set_enabled(&mut self, enabled: bool) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 334 | pub fn clear_cache(&mut self) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `set_jit_enabled`, `execute_without_profiling`, `clear_jit_cache`, `interpreter_mut`, and `interpreter` are never used [INFO] [stdout] --> src/runtime/jit_interpreter.rs:42:12 [INFO] [stdout] | [INFO] [stdout] 22 | impl JITInterpreter { [INFO] [stdout] | ------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 42 | pub fn set_jit_enabled(&mut self, enabled: bool) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 98 | pub fn execute_without_profiling( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 116 | pub fn clear_jit_cache(&mut self) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 121 | pub fn interpreter_mut(&mut self) -> &mut Interpreter { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 126 | pub fn interpreter(&self) -> &Interpreter { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `ExecutionMode` is never used [INFO] [stdout] --> src/runtime/mode.rs:10:10 [INFO] [stdout] | [INFO] [stdout] 10 | pub enum ExecutionMode { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ExecutionModeSelector` is never constructed [INFO] [stdout] --> src/runtime/mode.rs:22:12 [INFO] [stdout] | [INFO] [stdout] 22 | pub struct ExecutionModeSelector { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `new`, `select_mode`, `analyze_characteristics`, and `adapt_runtime` are never used [INFO] [stdout] --> src/runtime/mode.rs:29:12 [INFO] [stdout] | [INFO] [stdout] 27 | impl ExecutionModeSelector { [INFO] [stdout] | -------------------------- associated items in this implementation [INFO] [stdout] 28 | /// 创建新模式选择器 / Create new mode selector [INFO] [stdout] 29 | pub fn new() -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 36 | pub fn select_mode(&self, ast: &[GrammarElement]) -> ExecutionMode { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 52 | fn analyze_characteristics(&self, _ast: &[GrammarElement]) -> CodeCharacteristics { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 58 | pub fn adapt_runtime(&mut self, _mode: ExecutionMode, _runtime_data: &RuntimeMetrics) { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `CodeCharacteristics` is never constructed [INFO] [stdout] --> src/runtime/mode.rs:71:12 [INFO] [stdout] | [INFO] [stdout] 71 | pub struct CodeCharacteristics { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ExecutionMetrics` is never constructed [INFO] [stdout] --> src/runtime/mode.rs:98:12 [INFO] [stdout] | [INFO] [stdout] 98 | pub struct ExecutionMetrics { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `RuntimeMetrics` is never constructed [INFO] [stdout] --> src/runtime/mode.rs:116:12 [INFO] [stdout] | [INFO] [stdout] 116 | pub struct RuntimeMetrics { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `update_template_stats` is never used [INFO] [stdout] --> src/evolution/code_generator.rs:307:12 [INFO] [stdout] | [INFO] [stdout] 60 | impl IntelligentCodeGenerator { [INFO] [stdout] | ----------------------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 307 | pub fn update_template_stats(&mut self, template_name: &str, success: bool) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `nlu_parser` is never read [INFO] [stdout] --> src/evolution/engine.rs:25:5 [INFO] [stdout] | [INFO] [stdout] 17 | pub struct EvolutionEngine { [INFO] [stdout] | --------------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 25 | nlu_parser: NLUParser, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/evolution/analyzer.rs:158:5 [INFO] [stdout] | [INFO] [stdout] 158 | / fn collect_statistics_recursive( [INFO] [stdout] 159 | | &self, [INFO] [stdout] 160 | | elements: &[GrammarElement], [INFO] [stdout] 161 | | depth: usize, [INFO] [stdout] ... | [INFO] [stdout] 166 | | total_complexity: &mut f64, [INFO] [stdout] 167 | | ) { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: multiple associated items are never used [INFO] [stdout] --> src/evolution/engine.rs:61:12 [INFO] [stdout] | [INFO] [stdout] 34 | impl EvolutionEngine { [INFO] [stdout] | -------------------- associated items in this implementation [INFO] [stdout] ... [INFO] [stdout] 61 | pub fn evolve_from_natural_language( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 84 | fn generate_syntax_variants( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 98 | fn test_variants(&self, variants: Vec) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 108 | fn integrate_new_feature(&mut self, rule: GrammarRule) -> Result<(), EvolutionError> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 447 | pub fn rollback_to_event(&mut self, event_id: uuid::Uuid) -> Result<(), EvolutionError> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 474 | pub fn load_events_from_dir( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 875 | fn load_enhanced_bootstrap_rules() -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 891 | pub fn load_self_hosting_tools(&self) -> Result, EvolutionError> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 911 | pub fn validate_self_hosting_module(&self) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 921 | fn execute_evo_code(&self, code: &str) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 933 | fn intent_to_evo_dict(&self, intent: &crate::parser::nlu::ProgrammingIntent) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 949 | fn string_to_evo(&self, input: &str) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 954 | fn list_to_evo(&self, items: &[String]) -> String { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 959 | fn pairs_to_evo(&self, pairs: &[(String, String)]) -> String { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 967 | fn rules_from_value(&self, value: &Value) -> Result, EvolutionError> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `NLUError`, `NoVariants`, and `TestFailed` are never constructed [INFO] [stdout] --> src/evolution/engine.rs:1070:5 [INFO] [stdout] | [INFO] [stdout] 1068 | pub enum EvolutionError { [INFO] [stdout] | -------------- variants in this enum [INFO] [stdout] 1069 | /// NLU错误 / NLU error [INFO] [stdout] 1070 | NLUError(String), [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 1071 | /// 无变体 / No variants [INFO] [stdout] 1072 | NoVariants, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] 1073 | /// 测试失败 / Test failed [INFO] [stdout] 1074 | TestFailed(String), [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `EvolutionError` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: multiple methods are never used [INFO] [stdout] --> src/evolution/event_manager.rs:47:12 [INFO] [stdout] | [INFO] [stdout] 19 | impl EvolutionEventManager { [INFO] [stdout] | -------------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 47 | pub fn load_event(&self, event_id: Uuid) -> Result { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 62 | pub fn load_all_events(&self) -> Result, EventManagerError> { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 94 | pub fn validate_event(&self, event: &EvolutionEvent) -> Result<(), EventValidationError> { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 124 | pub fn detect_conflicts(&self, events: &[EvolutionEvent]) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 139 | fn check_event_conflict( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 187 | pub fn merge_events( [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 260 | fn select_best_event( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 281 | fn calculate_event_score(&self, event: &EvolutionEvent) -> f64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 292 | fn merge_metrics( [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/analyzer.rs:241:21 [INFO] [stdout] | [INFO] [stdout] 241 | / if first == "def" || first == "function" { [INFO] [stdout] 242 | | if list.len() > 10 { [INFO] [stdout] 243 | | patterns.push(CodePattern { [INFO] [stdout] 244 | | pattern_type: PatternType::LongFunction, [INFO] [stdout] ... | [INFO] [stdout] 250 | | } [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] 241 ~ if (first == "def" || first == "function") { [INFO] [stdout] 242 ~ && list.len() > 10 { [INFO] [stdout] 243 | patterns.push(CodePattern { [INFO] [stdout] ... [INFO] [stdout] 248 | }); [INFO] [stdout] 249 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/evolution/analyzer.rs:419:29 [INFO] [stdout] | [INFO] [stdout] 419 | / ... if *b != 0 { [INFO] [stdout] 420 | | ... a / b [INFO] [stdout] 421 | | ... } else { [INFO] [stdout] 422 | | ... return expr.clone(); [INFO] [stdout] 423 | | ... } [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] 418 ~ BinOp::Div [INFO] [stdout] 419 ~ if *b != 0 => { [INFO] [stdout] 420 | a / b [INFO] [stdout] 421 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/evolution/analyzer.rs:426:29 [INFO] [stdout] | [INFO] [stdout] 426 | / ... if *b != 0 { [INFO] [stdout] 427 | | ... a % b [INFO] [stdout] 428 | | ... } else { [INFO] [stdout] 429 | | ... return expr.clone(); [INFO] [stdout] 430 | | ... } [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] 425 ~ BinOp::Mod [INFO] [stdout] 426 ~ if *b != 0 => { [INFO] [stdout] 427 | a % b [INFO] [stdout] 428 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `DeserializationError`, `EmptyEventList`, and `ValidationError` are never constructed [INFO] [stdout] --> src/evolution/event_manager.rs:332:5 [INFO] [stdout] | [INFO] [stdout] 329 | pub enum EventManagerError { [INFO] [stdout] | ----------------- variants in this enum [INFO] [stdout] ... [INFO] [stdout] 332 | DeserializationError(serde_json::Error), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 333 | EmptyEventList, [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] 334 | ValidationError(EventValidationError), [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `EventManagerError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `InvalidId`, `InvalidState`, `EmptyDelta`, and `InvalidRule` are never constructed [INFO] [stdout] --> src/evolution/event_manager.rs:354:5 [INFO] [stdout] | [INFO] [stdout] 353 | pub enum EventValidationError { [INFO] [stdout] | -------------------- variants in this enum [INFO] [stdout] 354 | InvalidId, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] 355 | InvalidState, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] 356 | EmptyDelta, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] 357 | InvalidRule, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `EventValidationError` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `EventConflict` is never constructed [INFO] [stdout] --> src/evolution/event_manager.rs:362:12 [INFO] [stdout] | [INFO] [stdout] 362 | pub struct EventConflict { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `ConflictType` is never used [INFO] [stdout] --> src/evolution/event_manager.rs:371:10 [INFO] [stdout] | [INFO] [stdout] 371 | pub enum ConflictType { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `mine` is never used [INFO] [stdout] --> src/evolution/knowledge.rs:484:12 [INFO] [stdout] | [INFO] [stdout] 475 | impl PatternMiner { [INFO] [stdout] | ----------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 484 | pub fn mine(&mut self, events: &[EvolutionEvent]) -> Vec { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `set_threshold` is never used [INFO] [stdout] --> src/evolution/similarity.rs:111:12 [INFO] [stdout] | [INFO] [stdout] 101 | impl SimilarityDetector { [INFO] [stdout] | ----------------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 111 | pub fn set_threshold(&mut self, threshold: f64) { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `record_test_results` is never used [INFO] [stdout] --> src/evolution/test_generator.rs:353:12 [INFO] [stdout] | [INFO] [stdout] 115 | impl TestGenerator { [INFO] [stdout] | ------------------ method in this implementation [INFO] [stdout] ... [INFO] [stdout] 353 | pub fn record_test_results(&mut self, passed: usize, failed: usize) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `rollback_to` and `load_events_from_dir` are never used [INFO] [stdout] --> src/evolution/tracker.rs:92:12 [INFO] [stdout] | [INFO] [stdout] 18 | impl EvolutionTracker { [INFO] [stdout] | --------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 92 | pub fn rollback_to(&mut self, event_id: Uuid) -> Result { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 192 | pub fn load_events_from_dir( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `remove_event_and_descendants` is never used [INFO] [stdout] --> src/evolution/tracker.rs:356:12 [INFO] [stdout] | [INFO] [stdout] 332 | impl EvolutionGenealogy { [INFO] [stdout] | ----------------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 356 | pub fn remove_event_and_descendants(&mut self, event_id: Uuid) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `DEF` is never used [INFO] [stdout] --> src/grammar/core.rs:138:15 [INFO] [stdout] | [INFO] [stdout] 138 | pub const DEF: &str = "def"; [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `LET` is never used [INFO] [stdout] --> src/grammar/core.rs:139:15 [INFO] [stdout] | [INFO] [stdout] 139 | pub const LET: &str = "let"; [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `IF` is never used [INFO] [stdout] --> src/grammar/core.rs:140:15 [INFO] [stdout] | [INFO] [stdout] 140 | pub const IF: &str = "if"; [INFO] [stdout] | ^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `THEN` is never used [INFO] [stdout] --> src/grammar/core.rs:141:15 [INFO] [stdout] | [INFO] [stdout] 141 | pub const THEN: &str = "then"; [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `ELSE` is never used [INFO] [stdout] --> src/grammar/core.rs:142:15 [INFO] [stdout] | [INFO] [stdout] 142 | pub const ELSE: &str = "else"; [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `FUNCTION` is never used [INFO] [stdout] --> src/grammar/core.rs:143:15 [INFO] [stdout] | [INFO] [stdout] 143 | pub const FUNCTION: &str = "function"; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `RETURN` is never used [INFO] [stdout] --> src/grammar/core.rs:144:15 [INFO] [stdout] | [INFO] [stdout] 144 | pub const RETURN: &str = "return"; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `update` and `matches` are never used [INFO] [stdout] --> src/grammar/rule.rs:149:12 [INFO] [stdout] | [INFO] [stdout] 133 | impl GrammarRule { [INFO] [stdout] | ---------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 149 | pub fn update(&mut self, pattern: Pattern, production: Production, meta: RuleMetadata) { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 157 | pub fn matches(&self, _input: &[GrammarElement]) -> bool { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `recursive` is never used [INFO] [stdout] --> src/grammar/self_desc.rs:32:12 [INFO] [stdout] | [INFO] [stdout] 21 | impl SelfDescribingRule { [INFO] [stdout] | ----------------------- associated function in this implementation [INFO] [stdout] ... [INFO] [stdout] 32 | pub fn recursive( [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `rules` and `allow_experimental` are never read [INFO] [stdout] --> src/parser/adaptive.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 9 | pub struct AdaptiveParser { [INFO] [stdout] | -------------- fields in this struct [INFO] [stdout] 10 | /// 语法规则列表 / List of grammar rules [INFO] [stdout] 11 | rules: Vec, [INFO] [stdout] | ^^^^^ [INFO] [stdout] 12 | /// 是否允许实验性语法 / Whether experimental syntax is allowed [INFO] [stdout] 13 | allow_experimental: bool, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `add_rule`, `found_unknown_syntax`, `is_unknown_keyword`, and `propose_syntax_expansion` are never used [INFO] [stdout] --> src/parser/adaptive.rs:26:12 [INFO] [stdout] | [INFO] [stdout] 16 | impl AdaptiveParser { [INFO] [stdout] | ------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 26 | pub fn add_rule(&mut self, rule: GrammarRule) { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 39 | pub fn found_unknown_syntax(&self, ast: &[GrammarElement]) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 53 | fn is_unknown_keyword(&self, atom: &str) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 62 | pub fn propose_syntax_expansion(&self, _ast: &[GrammarElement]) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `NotImplemented`, `UnknownSyntax`, and `RuleConflict` are never constructed [INFO] [stdout] --> src/parser/adaptive.rs:1332:5 [INFO] [stdout] | [INFO] [stdout] 1330 | pub enum ParseError { [INFO] [stdout] | ---------- variants in this enum [INFO] [stdout] 1331 | /// 未实现 / Not implemented [INFO] [stdout] 1332 | NotImplemented, [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 1339 | UnknownSyntax { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 1344 | RuleConflict { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `unknown_syntax`, `message`, and `location` are never used [INFO] [stdout] --> src/parser/adaptive.rs:1357:12 [INFO] [stdout] | [INFO] [stdout] 1350 | impl ParseError { [INFO] [stdout] | --------------- associated items in this implementation [INFO] [stdout] ... [INFO] [stdout] 1357 | pub fn unknown_syntax(message: String, location: Option) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 1362 | pub fn message(&self) -> &str { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 1372 | pub fn location(&self) -> Option { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `session_id` is never read [INFO] [stdout] --> src/parser/context.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 11 | pub struct ContextManager { [INFO] [stdout] | -------------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 19 | session_id: String, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `get_context`, `clear`, and `update_execution_result` are never used [INFO] [stdout] --> src/parser/context.rs:93:12 [INFO] [stdout] | [INFO] [stdout] 39 | impl ContextManager { [INFO] [stdout] | ------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 93 | pub fn get_context(&self, lookback: usize) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 293 | pub fn clear(&mut self) { [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 300 | pub fn update_execution_result(&mut self, turn_id: usize, result: String) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `ReferenceNotFound` and `ParseError` are never constructed [INFO] [stdout] --> src/parser/context.rs:348:5 [INFO] [stdout] | [INFO] [stdout] 346 | pub enum ContextError { [INFO] [stdout] | ------------ variants in this enum [INFO] [stdout] 347 | /// 未找到引用 / Reference not found [INFO] [stdout] 348 | ReferenceNotFound(String), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] 349 | /// 解析错误 / Parse error [INFO] [stdout] 350 | ParseError(String), [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `ContextError` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `model_type` and `use_local` are never read [INFO] [stdout] --> src/parser/nlu.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 10 | pub struct NLUParser { [INFO] [stdout] | --------- fields in this struct [INFO] [stdout] 11 | /// 使用的模型类型 / Model type used [INFO] [stdout] 12 | model_type: ModelType, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] 13 | /// 是否使用本地模型 / Whether to use local model [INFO] [stdout] 14 | use_local: bool, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `number_patterns` is never read [INFO] [stdout] --> src/parser/nlu.rs:43:5 [INFO] [stdout] | [INFO] [stdout] 35 | struct RuleDatabase { [INFO] [stdout] | ------------ field in this struct [INFO] [stdout] ... [INFO] [stdout] 43 | number_patterns: Vec<&'static str>, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `NotImplemented`, `ModelError`, and `AmbiguousIntent` are never constructed [INFO] [stdout] --> src/parser/nlu.rs:1067:5 [INFO] [stdout] | [INFO] [stdout] 1065 | pub enum NLUError { [INFO] [stdout] | -------- variants in this enum [INFO] [stdout] 1066 | /// 未实现 / Not implemented [INFO] [stdout] 1067 | NotImplemented, [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] 1068 | /// 模型错误 / Model error [INFO] [stdout] 1069 | ModelError(String), [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] 1070 | /// 意图不明确 / Ambiguous intent [INFO] [stdout] 1071 | AmbiguousIntent(String), [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `NLUError` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant `AnalysisError` is never constructed [INFO] [stdout] --> src/poetry/emotion.rs:166:5 [INFO] [stdout] | [INFO] [stdout] 164 | pub enum EmotionError { [INFO] [stdout] | ------------ variant in this enum [INFO] [stdout] 165 | /// 分析错误 / Analysis error [INFO] [stdout] 166 | AnalysisError(String), [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `EmotionError` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant `ParseError` is never constructed [INFO] [stdout] --> src/poetry/parser.rs:216:5 [INFO] [stdout] | [INFO] [stdout] 214 | pub enum PoetryError { [INFO] [stdout] | ----------- variant in this enum [INFO] [stdout] 215 | /// 解析错误 / Parse error [INFO] [stdout] 216 | ParseError(String), [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `PoetryError` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `PyBridge` is never constructed [INFO] [stdout] --> src/python/bridge.rs:11:12 [INFO] [stdout] | [INFO] [stdout] 11 | pub struct PyBridge { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `new`, `initialize`, `import_module`, `call_function`, `execute_code`, and `eval` are never used [INFO] [stdout] --> src/python/bridge.rs:18:12 [INFO] [stdout] | [INFO] [stdout] 16 | impl PyBridge { [INFO] [stdout] | ------------- associated items in this implementation [INFO] [stdout] 17 | /// 创建新桥接器 / Create new bridge [INFO] [stdout] 18 | pub fn new() -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 23 | pub fn initialize(&mut self) -> Result<(), PyBridgeError> { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 35 | pub fn import_module(&self, module_name: &str) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 79 | pub fn call_function( [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 118 | pub fn execute_code(&self, code: &str) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 137 | pub fn eval(&self, expression: &str) -> Result { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `PyModuleInfo` is never constructed [INFO] [stdout] --> src/python/bridge.rs:160:12 [INFO] [stdout] | [INFO] [stdout] 160 | pub struct PyModuleInfo { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `PyValue` is never used [INFO] [stdout] --> src/python/bridge.rs:169:10 [INFO] [stdout] | [INFO] [stdout] 169 | pub enum PyValue { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `from_evo_value` and `to_evo_value` are never used [INFO] [stdout] --> src/python/bridge.rs:188:12 [INFO] [stdout] | [INFO] [stdout] 186 | impl PyValue { [INFO] [stdout] | ------------ associated items in this implementation [INFO] [stdout] 187 | /// 从Evo-lang Value转换 / Convert from Evo-lang Value [INFO] [stdout] 188 | pub fn from_evo_value(value: &crate::runtime::interpreter::Value) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 210 | pub fn to_evo_value(&self) -> crate::runtime::interpreter::Value { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `PyBridgeError` is never used [INFO] [stdout] --> src/python/bridge.rs:231:10 [INFO] [stdout] | [INFO] [stdout] 231 | pub enum PyBridgeError { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `py_value_to_pyobject_bound` is never used [INFO] [stdout] --> src/python/bridge.rs:262:4 [INFO] [stdout] | [INFO] [stdout] 262 | fn py_value_to_pyobject_bound<'py>( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `pyobject_to_py_value_bound` is never used [INFO] [stdout] --> src/python/bridge.rs:292:4 [INFO] [stdout] | [INFO] [stdout] 292 | fn pyobject_to_py_value_bound<'py>( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `captured_env` is never read [INFO] [stdout] --> src/runtime/interpreter.rs:37:5 [INFO] [stdout] | [INFO] [stdout] 31 | struct Function { [INFO] [stdout] | -------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 37 | captured_env: Option>, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Function` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `eval_expr_list` and `call_user_function` are never used [INFO] [stdout] --> src/runtime/interpreter.rs:119:8 [INFO] [stdout] | [INFO] [stdout] 53 | impl Interpreter { [INFO] [stdout] | ---------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 119 | fn eval_expr_list(&mut self, exprs: &[Expr]) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 2014 | fn call_user_function( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/runtime/interpreter.rs:3077:12 [INFO] [stdout] | [INFO] [stdout] 3076 | impl Location { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3077 | pub fn new(line: usize, column: usize) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant `NotImplemented` is never constructed [INFO] [stdout] --> src/runtime/interpreter.rs:3090:5 [INFO] [stdout] | [INFO] [stdout] 3088 | pub enum InterpreterError { [INFO] [stdout] | ---------------- variant in this enum [INFO] [stdout] 3089 | /// 未实现 / Not implemented [INFO] [stdout] 3090 | NotImplemented, [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `InterpreterError` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `compiled_at_timestamp` is never read [INFO] [stdout] --> src/runtime/jit.rs:31:5 [INFO] [stdout] | [INFO] [stdout] 25 | pub struct CompiledCode { [INFO] [stdout] | ------------ field in this struct [INFO] [stdout] ... [INFO] [stdout] 31 | compiled_at_timestamp: u64, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `CompiledCode` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `set_enabled` and `clear_cache` are never used [INFO] [stdout] --> src/runtime/jit.rs:71:12 [INFO] [stdout] | [INFO] [stdout] 49 | impl JITCompiler { [INFO] [stdout] | ---------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 71 | pub fn set_enabled(&mut self, enabled: bool) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 334 | pub fn clear_cache(&mut self) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `set_jit_enabled`, `execute_without_profiling`, `clear_jit_cache`, `interpreter_mut`, and `interpreter` are never used [INFO] [stdout] --> src/runtime/jit_interpreter.rs:42:12 [INFO] [stdout] | [INFO] [stdout] 22 | impl JITInterpreter { [INFO] [stdout] | ------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 42 | pub fn set_jit_enabled(&mut self, enabled: bool) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 98 | pub fn execute_without_profiling( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 116 | pub fn clear_jit_cache(&mut self) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 121 | pub fn interpreter_mut(&mut self) -> &mut Interpreter { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 126 | pub fn interpreter(&self) -> &Interpreter { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `ExecutionMode` is never used [INFO] [stdout] --> src/runtime/mode.rs:10:10 [INFO] [stdout] | [INFO] [stdout] 10 | pub enum ExecutionMode { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ExecutionModeSelector` is never constructed [INFO] [stdout] --> src/runtime/mode.rs:22:12 [INFO] [stdout] | [INFO] [stdout] 22 | pub struct ExecutionModeSelector { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `new`, `select_mode`, `analyze_characteristics`, and `adapt_runtime` are never used [INFO] [stdout] --> src/runtime/mode.rs:29:12 [INFO] [stdout] | [INFO] [stdout] 27 | impl ExecutionModeSelector { [INFO] [stdout] | -------------------------- associated items in this implementation [INFO] [stdout] 28 | /// 创建新模式选择器 / Create new mode selector [INFO] [stdout] 29 | pub fn new() -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 36 | pub fn select_mode(&self, ast: &[GrammarElement]) -> ExecutionMode { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 52 | fn analyze_characteristics(&self, _ast: &[GrammarElement]) -> CodeCharacteristics { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 58 | pub fn adapt_runtime(&mut self, _mode: ExecutionMode, _runtime_data: &RuntimeMetrics) { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `CodeCharacteristics` is never constructed [INFO] [stdout] --> src/runtime/mode.rs:71:12 [INFO] [stdout] | [INFO] [stdout] 71 | pub struct CodeCharacteristics { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ExecutionMetrics` is never constructed [INFO] [stdout] --> src/runtime/mode.rs:98:12 [INFO] [stdout] | [INFO] [stdout] 98 | pub struct ExecutionMetrics { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `RuntimeMetrics` is never constructed [INFO] [stdout] --> src/runtime/mode.rs:116:12 [INFO] [stdout] | [INFO] [stdout] 116 | pub struct RuntimeMetrics { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/evolution/code_generator.rs:288:13 [INFO] [stdout] | [INFO] [stdout] 288 | / match insight.insight_type { [INFO] [stdout] 289 | | crate::evolution::learning::InsightType::CodeSimplification => { [INFO] [stdout] 290 | | // 简化代码 / Simplify code [INFO] [stdout] 291 | | if let Some(suggestion) = &insight.suggestion { [INFO] [stdout] ... | [INFO] [stdout] 299 | | _ => {} [INFO] [stdout] 300 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 288 ~ if let crate::evolution::learning::InsightType::CodeSimplification = insight.insight_type { [INFO] [stdout] 289 ~ // 简化代码 / Simplify code [INFO] [stdout] 290 + if let Some(suggestion) = &insight.suggestion { [INFO] [stdout] 291 ~ if suggestion.contains("简化") { [INFO] [stdout] 292 ~ // 应用简化规则 / Apply simplification rules [INFO] [stdout] 293 + optimized = optimized.replace("(+ 0 ", "(+ "); [INFO] [stdout] 294 + optimized = optimized.replace("(* 1 ", "(* "); [INFO] [stdout] 295 + } [INFO] [stdout] 296 + } [INFO] [stdout] 297 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/evolution/analyzer.rs:158:5 [INFO] [stdout] | [INFO] [stdout] 158 | / fn collect_statistics_recursive( [INFO] [stdout] 159 | | &self, [INFO] [stdout] 160 | | elements: &[GrammarElement], [INFO] [stdout] 161 | | depth: usize, [INFO] [stdout] ... | [INFO] [stdout] 166 | | total_complexity: &mut f64, [INFO] [stdout] 167 | | ) { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/analyzer.rs:241:21 [INFO] [stdout] | [INFO] [stdout] 241 | / if first == "def" || first == "function" { [INFO] [stdout] 242 | | if list.len() > 10 { [INFO] [stdout] 243 | | patterns.push(CodePattern { [INFO] [stdout] 244 | | pattern_type: PatternType::LongFunction, [INFO] [stdout] ... | [INFO] [stdout] 250 | | } [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] 241 ~ if (first == "def" || first == "function") { [INFO] [stdout] 242 ~ && list.len() > 10 { [INFO] [stdout] 243 | patterns.push(CodePattern { [INFO] [stdout] ... [INFO] [stdout] 248 | }); [INFO] [stdout] 249 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/evolution/analyzer.rs:419:29 [INFO] [stdout] | [INFO] [stdout] 419 | / ... if *b != 0 { [INFO] [stdout] 420 | | ... a / b [INFO] [stdout] 421 | | ... } else { [INFO] [stdout] 422 | | ... return expr.clone(); [INFO] [stdout] 423 | | ... } [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] 418 ~ BinOp::Div [INFO] [stdout] 419 ~ if *b != 0 => { [INFO] [stdout] 420 | a / b [INFO] [stdout] 421 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/evolution/analyzer.rs:426:29 [INFO] [stdout] | [INFO] [stdout] 426 | / ... if *b != 0 { [INFO] [stdout] 427 | | ... a % b [INFO] [stdout] 428 | | ... } else { [INFO] [stdout] 429 | | ... return expr.clone(); [INFO] [stdout] 430 | | ... } [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] 425 ~ BinOp::Mod [INFO] [stdout] 426 ~ if *b != 0 => { [INFO] [stdout] 427 | a % b [INFO] [stdout] 428 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/evolution/code_generator.rs:288:13 [INFO] [stdout] | [INFO] [stdout] 288 | / match insight.insight_type { [INFO] [stdout] 289 | | crate::evolution::learning::InsightType::CodeSimplification => { [INFO] [stdout] 290 | | // 简化代码 / Simplify code [INFO] [stdout] 291 | | if let Some(suggestion) = &insight.suggestion { [INFO] [stdout] ... | [INFO] [stdout] 299 | | _ => {} [INFO] [stdout] 300 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 288 ~ if let crate::evolution::learning::InsightType::CodeSimplification = insight.insight_type { [INFO] [stdout] 289 ~ // 简化代码 / Simplify code [INFO] [stdout] 290 + if let Some(suggestion) = &insight.suggestion { [INFO] [stdout] 291 ~ if suggestion.contains("简化") { [INFO] [stdout] 292 ~ // 应用简化规则 / Apply simplification rules [INFO] [stdout] 293 + optimized = optimized.replace("(+ 0 ", "(+ "); [INFO] [stdout] 294 + optimized = optimized.replace("(* 1 ", "(* "); [INFO] [stdout] 295 + } [INFO] [stdout] 296 + } [INFO] [stdout] 297 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/dependency.rs:176:21 [INFO] [stdout] | [INFO] [stdout] 176 | / if first == "def" || first == "function" { [INFO] [stdout] 177 | | if list.len() >= 3 { [INFO] [stdout] 178 | | if let GrammarElement::Atom(function_name) = &list[1] { [INFO] [stdout] 179 | | let mut deps = Vec::new(); [INFO] [stdout] ... | [INFO] [stdout] 189 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 176 ~ if (first == "def" || first == "function") { [INFO] [stdout] 177 ~ && list.len() >= 3 { [INFO] [stdout] 178 | if let GrammarElement::Atom(function_name) = &list[1] { [INFO] [stdout] ... [INFO] [stdout] 187 | } [INFO] [stdout] 188 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/dependency.rs:226:21 [INFO] [stdout] | [INFO] [stdout] 226 | / if first == "def" || first == "function" { [INFO] [stdout] 227 | | if list.len() >= 3 { [INFO] [stdout] 228 | | if let GrammarElement::Atom(function_name) = &list[1] { [INFO] [stdout] ... | [INFO] [stdout] 242 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 226 ~ if (first == "def" || first == "function") { [INFO] [stdout] 227 ~ && list.len() >= 3 { [INFO] [stdout] 228 | if let GrammarElement::Atom(function_name) = &list[1] { [INFO] [stdout] ... [INFO] [stdout] 240 | } [INFO] [stdout] 241 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/evolution/doc_generator.rs:249:23 [INFO] [stdout] | [INFO] [stdout] 249 | doc.push_str(&format!("## 概览 / Overview\n\n")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"## 概览 / Overview\n\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/doc_generator.rs:269:21 [INFO] [stdout] | [INFO] [stdout] 269 | / if first == "def" || first == "function" { [INFO] [stdout] 270 | | if list.len() >= 3 { [INFO] [stdout] 271 | | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] 272 | | doc.push_str(&format!("### {}\n\n", name)); [INFO] [stdout] ... | [INFO] [stdout] 292 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 269 ~ if (first == "def" || first == "function") { [INFO] [stdout] 270 ~ && list.len() >= 3 { [INFO] [stdout] 271 | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] ... [INFO] [stdout] 290 | } [INFO] [stdout] 291 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/evolution/doc_generator.rs:273:47 [INFO] [stdout] | [INFO] [stdout] 273 | ... doc.push_str(&format!("**描述 / Description**: 函数定义\n\n")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"**描述 / Description**: 函数定义\n\n".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: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/evolution/doc_generator.rs:283:37 [INFO] [stdout] | [INFO] [stdout] 283 | ... doc.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `doc.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/doc_generator.rs:316:21 [INFO] [stdout] | [INFO] [stdout] 316 | / if first == "def" || first == "function" { [INFO] [stdout] 317 | | if list.len() >= 3 { [INFO] [stdout] 318 | | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] 319 | | doc.push_str(&format!("### `{}`\n\n", name)); [INFO] [stdout] ... | [INFO] [stdout] 323 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 316 ~ if (first == "def" || first == "function") { [INFO] [stdout] 317 ~ && list.len() >= 3 { [INFO] [stdout] 318 | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] ... [INFO] [stdout] 321 | } [INFO] [stdout] 322 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/doc_generator.rs:338:21 [INFO] [stdout] | [INFO] [stdout] 338 | / if first == "def" || first == "function" { [INFO] [stdout] 339 | | if list.len() >= 3 { [INFO] [stdout] 340 | | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] 341 | | doc.push_str(&format!(";; 函数: {}\n", name)); [INFO] [stdout] ... | [INFO] [stdout] 346 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 338 ~ if (first == "def" || first == "function") { [INFO] [stdout] 339 ~ && list.len() >= 3 { [INFO] [stdout] 340 | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] ... [INFO] [stdout] 344 | } [INFO] [stdout] 345 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/evolution/doc_generator.rs:343:33 [INFO] [stdout] | [INFO] [stdout] 343 | ... doc.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `doc.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/evolution/engine.rs:452:22 [INFO] [stdout] | [INFO] [stdout] 452 | .map_err(|e| EvolutionError::IntegrationFailed(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EvolutionError::IntegrationFailed` [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/evolution/engine.rs:470:22 [INFO] [stdout] | [INFO] [stdout] 470 | .map_err(|e| EvolutionError::IntegrationFailed(e)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EvolutionError::IntegrationFailed` [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/evolution/engine.rs:480:22 [INFO] [stdout] | [INFO] [stdout] 480 | .map_err(|e| EvolutionError::IntegrationFailed(e)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EvolutionError::IntegrationFailed` [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 `if` statement can be collapsed [INFO] [stdout] --> src/evolution/dependency.rs:176:21 [INFO] [stdout] | [INFO] [stdout] 176 | / if first == "def" || first == "function" { [INFO] [stdout] 177 | | if list.len() >= 3 { [INFO] [stdout] 178 | | if let GrammarElement::Atom(function_name) = &list[1] { [INFO] [stdout] 179 | | let mut deps = Vec::new(); [INFO] [stdout] ... | [INFO] [stdout] 189 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 176 ~ if (first == "def" || first == "function") { [INFO] [stdout] 177 ~ && list.len() >= 3 { [INFO] [stdout] 178 | if let GrammarElement::Atom(function_name) = &list[1] { [INFO] [stdout] ... [INFO] [stdout] 187 | } [INFO] [stdout] 188 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/dependency.rs:226:21 [INFO] [stdout] | [INFO] [stdout] 226 | / if first == "def" || first == "function" { [INFO] [stdout] 227 | | if list.len() >= 3 { [INFO] [stdout] 228 | | if let GrammarElement::Atom(function_name) = &list[1] { [INFO] [stdout] ... | [INFO] [stdout] 242 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 226 ~ if (first == "def" || first == "function") { [INFO] [stdout] 227 ~ && list.len() >= 3 { [INFO] [stdout] 228 | if let GrammarElement::Atom(function_name) = &list[1] { [INFO] [stdout] ... [INFO] [stdout] 240 | } [INFO] [stdout] 241 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/evolution/engine.rs:807:17 [INFO] [stdout] | [INFO] [stdout] 807 | format!("(def nostalgia () \"思念故乡的情感\")") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"(def nostalgia () \"思念故乡的情感\")".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] --> src/evolution/engine.rs:810:17 [INFO] [stdout] | [INFO] [stdout] 810 | format!("(def tranquility () \"夜晚的宁静,内心的平和\")") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"(def tranquility () \"夜晚的宁静,内心的平和\")".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] --> src/evolution/engine.rs:813:17 [INFO] [stdout] | [INFO] [stdout] 813 | format!("(def loneliness () \"孤独感,缺少陪伴\")") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"(def loneliness () \"孤独感,缺少陪伴\")".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: redundant closure [INFO] [stdout] --> src/evolution/event_manager.rs:30:54 [INFO] [stdout] | [INFO] [stdout] 30 | fs::create_dir_all(&self.events_dir).map_err(|e| EventManagerError::IoError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EventManagerError::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/evolution/event_manager.rs:38:22 [INFO] [stdout] | [INFO] [stdout] 38 | .map_err(|e| EventManagerError::SerializationError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EventManagerError::SerializationError` [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/evolution/event_manager.rs:41:44 [INFO] [stdout] | [INFO] [stdout] 41 | fs::write(&filepath, json).map_err(|e| EventManagerError::IoError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EventManagerError::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/evolution/event_manager.rs:52:61 [INFO] [stdout] | [INFO] [stdout] 52 | let content = fs::read_to_string(&filepath).map_err(|e| EventManagerError::IoError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EventManagerError::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/evolution/event_manager.rs:56:22 [INFO] [stdout] | [INFO] [stdout] 56 | .map_err(|e| EventManagerError::DeserializationError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EventManagerError::DeserializationError` [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/evolution/event_manager.rs:71:62 [INFO] [stdout] | [INFO] [stdout] 71 | let entries = fs::read_dir(&self.events_dir).map_err(|e| EventManagerError::IoError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EventManagerError::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/evolution/event_manager.rs:74:39 [INFO] [stdout] | [INFO] [stdout] 74 | let entry = entry.map_err(|e| EventManagerError::IoError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EventManagerError::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: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/event_manager.rs:88:9 [INFO] [stdout] | [INFO] [stdout] 88 | events.sort_by(|a, b| a.timestamp.cmp(&b.timestamp)); [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] 88 - events.sort_by(|a, b| a.timestamp.cmp(&b.timestamp)); [INFO] [stdout] 88 + events.sort_by_key(|a| a.timestamp); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/evolution/doc_generator.rs:249:23 [INFO] [stdout] | [INFO] [stdout] 249 | doc.push_str(&format!("## 概览 / Overview\n\n")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"## 概览 / Overview\n\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/doc_generator.rs:269:21 [INFO] [stdout] | [INFO] [stdout] 269 | / if first == "def" || first == "function" { [INFO] [stdout] 270 | | if list.len() >= 3 { [INFO] [stdout] 271 | | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] 272 | | doc.push_str(&format!("### {}\n\n", name)); [INFO] [stdout] ... | [INFO] [stdout] 292 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 269 ~ if (first == "def" || first == "function") { [INFO] [stdout] 270 ~ && list.len() >= 3 { [INFO] [stdout] 271 | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] ... [INFO] [stdout] 290 | } [INFO] [stdout] 291 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/evolution/doc_generator.rs:273:47 [INFO] [stdout] | [INFO] [stdout] 273 | ... doc.push_str(&format!("**描述 / Description**: 函数定义\n\n")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"**描述 / Description**: 函数定义\n\n".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: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/event_manager.rs:204:9 [INFO] [stdout] | [INFO] [stdout] 204 | sorted_events.sort_by(|a, b| a.timestamp.cmp(&b.timestamp)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 204 - sorted_events.sort_by(|a, b| a.timestamp.cmp(&b.timestamp)); [INFO] [stdout] 204 + sorted_events.sort_by_key(|a| a.timestamp); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/evolution/doc_generator.rs:283:37 [INFO] [stdout] | [INFO] [stdout] 283 | ... doc.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `doc.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/doc_generator.rs:316:21 [INFO] [stdout] | [INFO] [stdout] 316 | / if first == "def" || first == "function" { [INFO] [stdout] 317 | | if list.len() >= 3 { [INFO] [stdout] 318 | | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] 319 | | doc.push_str(&format!("### `{}`\n\n", name)); [INFO] [stdout] ... | [INFO] [stdout] 323 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 316 ~ if (first == "def" || first == "function") { [INFO] [stdout] 317 ~ && list.len() >= 3 { [INFO] [stdout] 318 | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] ... [INFO] [stdout] 321 | } [INFO] [stdout] 322 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/doc_generator.rs:338:21 [INFO] [stdout] | [INFO] [stdout] 338 | / if first == "def" || first == "function" { [INFO] [stdout] 339 | | if list.len() >= 3 { [INFO] [stdout] 340 | | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] 341 | | doc.push_str(&format!(";; 函数: {}\n", name)); [INFO] [stdout] ... | [INFO] [stdout] 346 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 338 ~ if (first == "def" || first == "function") { [INFO] [stdout] 339 ~ && list.len() >= 3 { [INFO] [stdout] 340 | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] ... [INFO] [stdout] 344 | } [INFO] [stdout] 345 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/evolution/doc_generator.rs:343:33 [INFO] [stdout] | [INFO] [stdout] 343 | ... doc.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `doc.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/evolution/knowledge.rs:210:16 [INFO] [stdout] | [INFO] [stdout] 210 | if rule1.pattern.elements.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!rule1.pattern.elements.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` has identical blocks [INFO] [stdout] --> src/evolution/knowledge.rs:362:51 [INFO] [stdout] | [INFO] [stdout] 362 | if entity.starts_with("emotion:") { [INFO] [stdout] | ___________________________________________________^ [INFO] [stdout] 363 | | n.node_type = NodeType::Concept; [INFO] [stdout] 364 | | } else if entity.starts_with("theme:") { [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/evolution/knowledge.rs:364:56 [INFO] [stdout] | [INFO] [stdout] 364 | } else if entity.starts_with("theme:") { [INFO] [stdout] | ________________________________________________________^ [INFO] [stdout] 365 | | n.node_type = NodeType::Concept; [INFO] [stdout] 366 | | } else if entity.starts_with("imagery:") { [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 `if` has identical blocks [INFO] [stdout] --> src/evolution/knowledge.rs:364:56 [INFO] [stdout] | [INFO] [stdout] 364 | } else if entity.starts_with("theme:") { [INFO] [stdout] | ________________________________________________________^ [INFO] [stdout] 365 | | n.node_type = NodeType::Concept; [INFO] [stdout] 366 | | } else if entity.starts_with("imagery:") { [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/evolution/knowledge.rs:366:58 [INFO] [stdout] | [INFO] [stdout] 366 | } else if entity.starts_with("imagery:") { [INFO] [stdout] | __________________________________________________________^ [INFO] [stdout] 367 | | n.node_type = NodeType::Concept; [INFO] [stdout] 368 | | } [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] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/evolution/engine.rs:452:22 [INFO] [stdout] | [INFO] [stdout] 452 | .map_err(|e| EvolutionError::IntegrationFailed(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EvolutionError::IntegrationFailed` [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/evolution/engine.rs:470:22 [INFO] [stdout] | [INFO] [stdout] 470 | .map_err(|e| EvolutionError::IntegrationFailed(e)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EvolutionError::IntegrationFailed` [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/evolution/engine.rs:480:22 [INFO] [stdout] | [INFO] [stdout] 480 | .map_err(|e| EvolutionError::IntegrationFailed(e)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EvolutionError::IntegrationFailed` [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: useless use of `format!` [INFO] [stdout] --> src/evolution/engine.rs:807:17 [INFO] [stdout] | [INFO] [stdout] 807 | format!("(def nostalgia () \"思念故乡的情感\")") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"(def nostalgia () \"思念故乡的情感\")".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] --> src/evolution/engine.rs:810:17 [INFO] [stdout] | [INFO] [stdout] 810 | format!("(def tranquility () \"夜晚的宁静,内心的平和\")") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"(def tranquility () \"夜晚的宁静,内心的平和\")".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] --> src/evolution/engine.rs:813:17 [INFO] [stdout] | [INFO] [stdout] 813 | format!("(def loneliness () \"孤独感,缺少陪伴\")") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"(def loneliness () \"孤独感,缺少陪伴\")".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: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/evolution/knowledge.rs:494:22 [INFO] [stdout] | [INFO] [stdout] 494 | .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: redundant closure [INFO] [stdout] --> src/evolution/event_manager.rs:30:54 [INFO] [stdout] | [INFO] [stdout] 30 | fs::create_dir_all(&self.events_dir).map_err(|e| EventManagerError::IoError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EventManagerError::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/evolution/event_manager.rs:38:22 [INFO] [stdout] | [INFO] [stdout] 38 | .map_err(|e| EventManagerError::SerializationError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EventManagerError::SerializationError` [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/evolution/event_manager.rs:41:44 [INFO] [stdout] | [INFO] [stdout] 41 | fs::write(&filepath, json).map_err(|e| EventManagerError::IoError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EventManagerError::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/evolution/event_manager.rs:52:61 [INFO] [stdout] | [INFO] [stdout] 52 | let content = fs::read_to_string(&filepath).map_err(|e| EventManagerError::IoError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EventManagerError::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/evolution/event_manager.rs:56:22 [INFO] [stdout] | [INFO] [stdout] 56 | .map_err(|e| EventManagerError::DeserializationError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EventManagerError::DeserializationError` [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/evolution/event_manager.rs:71:62 [INFO] [stdout] | [INFO] [stdout] 71 | let entries = fs::read_dir(&self.events_dir).map_err(|e| EventManagerError::IoError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EventManagerError::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/evolution/event_manager.rs:74:39 [INFO] [stdout] | [INFO] [stdout] 74 | let entry = entry.map_err(|e| EventManagerError::IoError(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `EventManagerError::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: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/event_manager.rs:88:9 [INFO] [stdout] | [INFO] [stdout] 88 | events.sort_by(|a, b| a.timestamp.cmp(&b.timestamp)); [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] 88 - events.sort_by(|a, b| a.timestamp.cmp(&b.timestamp)); [INFO] [stdout] 88 + events.sort_by_key(|a| a.timestamp); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/event_manager.rs:204:9 [INFO] [stdout] | [INFO] [stdout] 204 | sorted_events.sort_by(|a, b| a.timestamp.cmp(&b.timestamp)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 204 - sorted_events.sort_by(|a, b| a.timestamp.cmp(&b.timestamp)); [INFO] [stdout] 204 + sorted_events.sort_by_key(|a| a.timestamp); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/evolution/learning.rs:78:29 [INFO] [stdout] | [INFO] [stdout] 78 | .or_insert_with(|| Vec::new()) [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Vec::new` [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/evolution/learning.rs:101:29 [INFO] [stdout] | [INFO] [stdout] 101 | .or_insert_with(|| Vec::new()) [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Vec::new` [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: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/learning.rs:136:9 [INFO] [stdout] | [INFO] [stdout] 136 | patterns.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] help: try [INFO] [stdout] | [INFO] [stdout] 136 - patterns.sort_by(|a, b| b.1.cmp(&a.1)); [INFO] [stdout] 136 + patterns.sort_by_key(|b| std::cmp::Reverse(b.1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/learning.rs:147:9 [INFO] [stdout] | [INFO] [stdout] 147 | all_errors.sort_by(|a, b| b.count.cmp(&a.count)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 147 - all_errors.sort_by(|a, b| b.count.cmp(&a.count)); [INFO] [stdout] 147 + all_errors.sort_by_key(|b| std::cmp::Reverse(b.count)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/learning.rs:159:9 [INFO] [stdout] | [INFO] [stdout] 159 | all_patterns.sort_by(|a, b| b.usage_count.cmp(&a.usage_count)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 159 - all_patterns.sort_by(|a, b| b.usage_count.cmp(&a.usage_count)); [INFO] [stdout] 159 + all_patterns.sort_by_key(|b| std::cmp::Reverse(b.usage_count)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/learning.rs:180:9 [INFO] [stdout] | [INFO] [stdout] 180 | insights.sort_by(|a, b| b.priority.cmp(&a.priority)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 180 - insights.sort_by(|a, b| b.priority.cmp(&a.priority)); [INFO] [stdout] 180 + insights.sort_by_key(|b| std::cmp::Reverse(b.priority)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/learning.rs:203:9 [INFO] [stdout] | [INFO] [stdout] 203 | insights.sort_by(|a, b| b.priority.cmp(&a.priority)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 203 - insights.sort_by(|a, b| b.priority.cmp(&a.priority)); [INFO] [stdout] 203 + insights.sort_by_key(|b| std::cmp::Reverse(b.priority)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/learning.rs:211:9 [INFO] [stdout] | [INFO] [stdout] 211 | insights.sort_by(|a, b| b.priority.cmp(&a.priority)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 211 - insights.sort_by(|a, b| b.priority.cmp(&a.priority)); [INFO] [stdout] 211 + insights.sort_by_key(|b| std::cmp::Reverse(b.priority)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/evolution/knowledge.rs:210:16 [INFO] [stdout] | [INFO] [stdout] 210 | if rule1.pattern.elements.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!rule1.pattern.elements.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` has identical blocks [INFO] [stdout] --> src/evolution/knowledge.rs:362:51 [INFO] [stdout] | [INFO] [stdout] 362 | if entity.starts_with("emotion:") { [INFO] [stdout] | ___________________________________________________^ [INFO] [stdout] 363 | | n.node_type = NodeType::Concept; [INFO] [stdout] 364 | | } else if entity.starts_with("theme:") { [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/evolution/knowledge.rs:364:56 [INFO] [stdout] | [INFO] [stdout] 364 | } else if entity.starts_with("theme:") { [INFO] [stdout] | ________________________________________________________^ [INFO] [stdout] 365 | | n.node_type = NodeType::Concept; [INFO] [stdout] 366 | | } else if entity.starts_with("imagery:") { [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 `if` has identical blocks [INFO] [stdout] --> src/evolution/knowledge.rs:364:56 [INFO] [stdout] | [INFO] [stdout] 364 | } else if entity.starts_with("theme:") { [INFO] [stdout] | ________________________________________________________^ [INFO] [stdout] 365 | | n.node_type = NodeType::Concept; [INFO] [stdout] 366 | | } else if entity.starts_with("imagery:") { [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/evolution/knowledge.rs:366:58 [INFO] [stdout] | [INFO] [stdout] 366 | } else if entity.starts_with("imagery:") { [INFO] [stdout] | __________________________________________________________^ [INFO] [stdout] 367 | | n.node_type = NodeType::Concept; [INFO] [stdout] 368 | | } [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] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/evolution/knowledge.rs:494:22 [INFO] [stdout] | [INFO] [stdout] 494 | .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: redundant closure [INFO] [stdout] --> src/evolution/learning.rs:78:29 [INFO] [stdout] | [INFO] [stdout] 78 | .or_insert_with(|| Vec::new()) [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Vec::new` [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/evolution/learning.rs:101:29 [INFO] [stdout] | [INFO] [stdout] 101 | .or_insert_with(|| Vec::new()) [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Vec::new` [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: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/learning.rs:136:9 [INFO] [stdout] | [INFO] [stdout] 136 | patterns.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] help: try [INFO] [stdout] | [INFO] [stdout] 136 - patterns.sort_by(|a, b| b.1.cmp(&a.1)); [INFO] [stdout] 136 + patterns.sort_by_key(|b| std::cmp::Reverse(b.1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/learning.rs:147:9 [INFO] [stdout] | [INFO] [stdout] 147 | all_errors.sort_by(|a, b| b.count.cmp(&a.count)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 147 - all_errors.sort_by(|a, b| b.count.cmp(&a.count)); [INFO] [stdout] 147 + all_errors.sort_by_key(|b| std::cmp::Reverse(b.count)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/learning.rs:159:9 [INFO] [stdout] | [INFO] [stdout] 159 | all_patterns.sort_by(|a, b| b.usage_count.cmp(&a.usage_count)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 159 - all_patterns.sort_by(|a, b| b.usage_count.cmp(&a.usage_count)); [INFO] [stdout] 159 + all_patterns.sort_by_key(|b| std::cmp::Reverse(b.usage_count)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/learning.rs:180:9 [INFO] [stdout] | [INFO] [stdout] 180 | insights.sort_by(|a, b| b.priority.cmp(&a.priority)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 180 - insights.sort_by(|a, b| b.priority.cmp(&a.priority)); [INFO] [stdout] 180 + insights.sort_by_key(|b| std::cmp::Reverse(b.priority)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/learning.rs:203:9 [INFO] [stdout] | [INFO] [stdout] 203 | insights.sort_by(|a, b| b.priority.cmp(&a.priority)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 203 - insights.sort_by(|a, b| b.priority.cmp(&a.priority)); [INFO] [stdout] 203 + insights.sort_by_key(|b| std::cmp::Reverse(b.priority)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/learning.rs:211:9 [INFO] [stdout] | [INFO] [stdout] 211 | insights.sort_by(|a, b| b.priority.cmp(&a.priority)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 211 - insights.sort_by(|a, b| b.priority.cmp(&a.priority)); [INFO] [stdout] 211 + insights.sort_by_key(|b| std::cmp::Reverse(b.priority)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/performance.rs:454:9 [INFO] [stdout] | [INFO] [stdout] 454 | score.max(0.0).min(100.0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `score.clamp(0.0, 100.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] = note: `#[warn(clippy::manual_clamp)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/performance.rs:454:9 [INFO] [stdout] | [INFO] [stdout] 454 | score.max(0.0).min(100.0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `score.clamp(0.0, 100.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] = note: `#[warn(clippy::manual_clamp)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/quality_assessor.rs:249:9 [INFO] [stdout] | [INFO] [stdout] 249 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(score as f64).clamp(0.0_f64, 100.0_f64)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`f64` -> `f64`) [INFO] [stdout] --> src/evolution/quality_assessor.rs:249:9 [INFO] [stdout] | [INFO] [stdout] 249 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `score` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/quality_assessor.rs:269:9 [INFO] [stdout] | [INFO] [stdout] 269 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(score as f64).clamp(0.0_f64, 100.0_f64)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`f64` -> `f64`) [INFO] [stdout] --> src/evolution/quality_assessor.rs:269:9 [INFO] [stdout] | [INFO] [stdout] 269 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `score` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/quality_assessor.rs:288:9 [INFO] [stdout] | [INFO] [stdout] 288 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(score as f64).clamp(0.0_f64, 100.0_f64)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`f64` -> `f64`) [INFO] [stdout] --> src/evolution/quality_assessor.rs:288:9 [INFO] [stdout] | [INFO] [stdout] 288 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `score` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/quality_assessor.rs:305:9 [INFO] [stdout] | [INFO] [stdout] 305 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(score as f64).clamp(0.0_f64, 100.0_f64)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`f64` -> `f64`) [INFO] [stdout] --> src/evolution/quality_assessor.rs:305:9 [INFO] [stdout] | [INFO] [stdout] 305 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `score` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/quality_assessor.rs:330:9 [INFO] [stdout] | [INFO] [stdout] 330 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(score as f64).clamp(0.0_f64, 100.0_f64)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`f64` -> `f64`) [INFO] [stdout] --> src/evolution/quality_assessor.rs:330:9 [INFO] [stdout] | [INFO] [stdout] 330 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `score` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `format!` in `format!` args [INFO] [stdout] --> src/evolution/quality_assessor.rs:417:30 [INFO] [stdout] | [INFO] [stdout] 417 | improvement: format!( [INFO] [stdout] | ______________________________^ [INFO] [stdout] 418 | | "{}: {} -> {}", [INFO] [stdout] 419 | | format!("{:?}", suggestion.suggestion_type), [INFO] [stdout] 420 | | suggestion.original, [INFO] [stdout] 421 | | suggestion.suggested [INFO] [stdout] 422 | | ), [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: combine the `format!(..)` arguments with the outer `format!(..)` call [INFO] [stdout] = help: or consider changing `format!` to `format_args!` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args [INFO] [stdout] = note: `#[warn(clippy::format_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/quality_assessor.rs:249:9 [INFO] [stdout] | [INFO] [stdout] 249 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(score as f64).clamp(0.0_f64, 100.0_f64)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`f64` -> `f64`) [INFO] [stdout] --> src/evolution/quality_assessor.rs:249:9 [INFO] [stdout] | [INFO] [stdout] 249 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `score` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/quality_assessor.rs:269:9 [INFO] [stdout] | [INFO] [stdout] 269 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(score as f64).clamp(0.0_f64, 100.0_f64)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`f64` -> `f64`) [INFO] [stdout] --> src/evolution/quality_assessor.rs:269:9 [INFO] [stdout] | [INFO] [stdout] 269 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `score` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/quality_assessor.rs:288:9 [INFO] [stdout] | [INFO] [stdout] 288 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(score as f64).clamp(0.0_f64, 100.0_f64)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`f64` -> `f64`) [INFO] [stdout] --> src/evolution/quality_assessor.rs:288:9 [INFO] [stdout] | [INFO] [stdout] 288 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `score` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/quality_assessor.rs:305:9 [INFO] [stdout] | [INFO] [stdout] 305 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(score as f64).clamp(0.0_f64, 100.0_f64)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`f64` -> `f64`) [INFO] [stdout] --> src/evolution/quality_assessor.rs:305:9 [INFO] [stdout] | [INFO] [stdout] 305 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `score` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/quality_assessor.rs:330:9 [INFO] [stdout] | [INFO] [stdout] 330 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(score as f64).clamp(0.0_f64, 100.0_f64)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`f64` -> `f64`) [INFO] [stdout] --> src/evolution/quality_assessor.rs:330:9 [INFO] [stdout] | [INFO] [stdout] 330 | (score as f64).max(0.0_f64).min(100.0_f64) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `score` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `format!` in `format!` args [INFO] [stdout] --> src/evolution/quality_assessor.rs:417:30 [INFO] [stdout] | [INFO] [stdout] 417 | improvement: format!( [INFO] [stdout] | ______________________________^ [INFO] [stdout] 418 | | "{}: {} -> {}", [INFO] [stdout] 419 | | format!("{:?}", suggestion.suggestion_type), [INFO] [stdout] 420 | | suggestion.original, [INFO] [stdout] 421 | | suggestion.suggested [INFO] [stdout] 422 | | ), [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: combine the `format!(..)` arguments with the outer `format!(..)` call [INFO] [stdout] = help: or consider changing `format!` to `format_args!` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args [INFO] [stdout] = note: `#[warn(clippy::format_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/similarity.rs:112:37 [INFO] [stdout] | [INFO] [stdout] 112 | self.similarity_threshold = threshold.max(0.0).min(1.0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `threshold.clamp(0.0, 1.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/evolution/similarity.rs:341:18 [INFO] [stdout] | [INFO] [stdout] 341 | .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] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/similarity.rs:365:9 [INFO] [stdout] | [INFO] [stdout] 365 | duplicates.sort_by(|a, b| b.count.cmp(&a.count)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 365 - duplicates.sort_by(|a, b| b.count.cmp(&a.count)); [INFO] [stdout] 365 + duplicates.sort_by_key(|b| std::cmp::Reverse(b.count)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/similarity.rs:441:9 [INFO] [stdout] | [INFO] [stdout] 441 | score.max(0.0).min(100.0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `score.clamp(0.0, 100.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/similarity.rs:112:37 [INFO] [stdout] | [INFO] [stdout] 112 | self.similarity_threshold = threshold.max(0.0).min(1.0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `threshold.clamp(0.0, 1.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: all variants have the same postfix: `Test` [INFO] [stdout] --> src/evolution/test_generator.rs:35:1 [INFO] [stdout] | [INFO] [stdout] 35 | / pub enum TestStrategyType { [INFO] [stdout] 36 | | /// 单元测试 / Unit test [INFO] [stdout] 37 | | UnitTest, [INFO] [stdout] 38 | | /// 集成测试 / Integration test [INFO] [stdout] ... | [INFO] [stdout] 45 | | RegressionTest, [INFO] [stdout] 46 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: remove the postfixes and use full paths to the variants instead of glob imports [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names [INFO] [stdout] = note: `#[warn(clippy::enum_variant_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/evolution/similarity.rs:341:18 [INFO] [stdout] | [INFO] [stdout] 341 | .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] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/evolution/similarity.rs:365:9 [INFO] [stdout] | [INFO] [stdout] 365 | duplicates.sort_by(|a, b| b.count.cmp(&a.count)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 365 - duplicates.sort_by(|a, b| b.count.cmp(&a.count)); [INFO] [stdout] 365 + duplicates.sort_by_key(|b| std::cmp::Reverse(b.count)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/evolution/similarity.rs:441:9 [INFO] [stdout] | [INFO] [stdout] 441 | score.max(0.0).min(100.0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `score.clamp(0.0, 100.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: all variants have the same postfix: `Test` [INFO] [stdout] --> src/evolution/test_generator.rs:35:1 [INFO] [stdout] | [INFO] [stdout] 35 | / pub enum TestStrategyType { [INFO] [stdout] 36 | | /// 单元测试 / Unit test [INFO] [stdout] 37 | | UnitTest, [INFO] [stdout] 38 | | /// 集成测试 / Integration test [INFO] [stdout] ... | [INFO] [stdout] 45 | | RegressionTest, [INFO] [stdout] 46 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: remove the postfixes and use full paths to the variants instead of glob imports [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names [INFO] [stdout] = note: `#[warn(clippy::enum_variant_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/test_generator.rs:173:21 [INFO] [stdout] | [INFO] [stdout] 173 | / if first == "def" || first == "function" { [INFO] [stdout] 174 | | if list.len() >= 3 { [INFO] [stdout] 175 | | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] ... | [INFO] [stdout] 185 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 173 ~ if (first == "def" || first == "function") { [INFO] [stdout] 174 ~ && list.len() >= 3 { [INFO] [stdout] 175 | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] ... [INFO] [stdout] 183 | } [INFO] [stdout] 184 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/evolution/test_generator.rs:332:37 [INFO] [stdout] | [INFO] [stdout] 332 | let statement_coverage = if test_cases.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!test_cases.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/tracker.rs:47:21 [INFO] [stdout] | [INFO] [stdout] 47 | / if new_rule.name.contains(&old_rule.name) [INFO] [stdout] 48 | | || old_rule.name.contains(&new_rule.name) [INFO] [stdout] 49 | | || new_rule.name == old_rule.name [INFO] [stdout] ... | [INFO] [stdout] 54 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 47 ~ if (new_rule.name.contains(&old_rule.name) [INFO] [stdout] 48 | || old_rule.name.contains(&new_rule.name) [INFO] [stdout] 49 ~ || new_rule.name == old_rule.name [INFO] [stdout] 50 ~ || new_rule.name == old_rule.name) [INFO] [stdout] 51 | { [INFO] [stdout] 52 ~ && !parents.contains(&prev_event.id) { [INFO] [stdout] 53 | parents.push(prev_event.id); [INFO] [stdout] 54 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/tracker.rs:61:21 [INFO] [stdout] | [INFO] [stdout] 61 | / if prev_new_rule.name == new_rule.name { [INFO] [stdout] 62 | | if !parents.contains(&prev_event.id) { [INFO] [stdout] 63 | | parents.push(prev_event.id); [INFO] [stdout] 64 | | } [INFO] [stdout] 65 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 61 ~ if prev_new_rule.name == new_rule.name [INFO] [stdout] 62 ~ && !parents.contains(&prev_event.id) { [INFO] [stdout] 63 | parents.push(prev_event.id); [INFO] [stdout] 64 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: all variants have the same postfix: `Evolution` [INFO] [stdout] --> src/evolution/tracker.rs:247:1 [INFO] [stdout] | [INFO] [stdout] 247 | / pub enum EvolutionType { [INFO] [stdout] 248 | | /// 语法进化 / Syntax evolution [INFO] [stdout] 249 | | SyntaxEvolution, [INFO] [stdout] 250 | | /// 语义进化 / Semantic evolution [INFO] [stdout] ... | [INFO] [stdout] 257 | | InteractionEvolution, [INFO] [stdout] 258 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: remove the postfixes and use full paths to the variants instead of glob imports [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/test_generator.rs:173:21 [INFO] [stdout] | [INFO] [stdout] 173 | / if first == "def" || first == "function" { [INFO] [stdout] 174 | | if list.len() >= 3 { [INFO] [stdout] 175 | | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] ... | [INFO] [stdout] 185 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 173 ~ if (first == "def" || first == "function") { [INFO] [stdout] 174 ~ && list.len() >= 3 { [INFO] [stdout] 175 | if let GrammarElement::Atom(name) = &list[1] { [INFO] [stdout] ... [INFO] [stdout] 183 | } [INFO] [stdout] 184 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/evolution/test_generator.rs:332:37 [INFO] [stdout] | [INFO] [stdout] 332 | let statement_coverage = if test_cases.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!test_cases.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/tracker.rs:47:21 [INFO] [stdout] | [INFO] [stdout] 47 | / if new_rule.name.contains(&old_rule.name) [INFO] [stdout] 48 | | || old_rule.name.contains(&new_rule.name) [INFO] [stdout] 49 | | || new_rule.name == old_rule.name [INFO] [stdout] ... | [INFO] [stdout] 54 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 47 ~ if (new_rule.name.contains(&old_rule.name) [INFO] [stdout] 48 | || old_rule.name.contains(&new_rule.name) [INFO] [stdout] 49 ~ || new_rule.name == old_rule.name [INFO] [stdout] 50 ~ || new_rule.name == old_rule.name) [INFO] [stdout] 51 | { [INFO] [stdout] 52 ~ && !parents.contains(&prev_event.id) { [INFO] [stdout] 53 | parents.push(prev_event.id); [INFO] [stdout] 54 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evolution/tracker.rs:61:21 [INFO] [stdout] | [INFO] [stdout] 61 | / if prev_new_rule.name == new_rule.name { [INFO] [stdout] 62 | | if !parents.contains(&prev_event.id) { [INFO] [stdout] 63 | | parents.push(prev_event.id); [INFO] [stdout] 64 | | } [INFO] [stdout] 65 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 61 ~ if prev_new_rule.name == new_rule.name [INFO] [stdout] 62 ~ && !parents.contains(&prev_event.id) { [INFO] [stdout] 63 | parents.push(prev_event.id); [INFO] [stdout] 64 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: all variants have the same postfix: `Evolution` [INFO] [stdout] --> src/evolution/tracker.rs:247:1 [INFO] [stdout] | [INFO] [stdout] 247 | / pub enum EvolutionType { [INFO] [stdout] 248 | | /// 语法进化 / Syntax evolution [INFO] [stdout] 249 | | SyntaxEvolution, [INFO] [stdout] 250 | | /// 语义进化 / Semantic evolution [INFO] [stdout] ... | [INFO] [stdout] 257 | | InteractionEvolution, [INFO] [stdout] 258 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: remove the postfixes and use full paths to the variants instead of glob imports [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/evolution/tracker.rs:345:18 [INFO] [stdout] | [INFO] [stdout] 345 | .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] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/evolution/tracker.rs:345:18 [INFO] [stdout] | [INFO] [stdout] 345 | .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] [INFO] [stdout] [INFO] [stdout] warning: all variants have the same postfix: `Check` [INFO] [stdout] --> src/grammar/rule.rs:81:1 [INFO] [stdout] | [INFO] [stdout] 81 | / pub enum Condition { [INFO] [stdout] 82 | | /// 类型检查 / Type check [INFO] [stdout] 83 | | TypeCheck(String, String), [INFO] [stdout] 84 | | /// 值检查 / Value check [INFO] [stdout] ... | [INFO] [stdout] 87 | | ContextCheck(String), [INFO] [stdout] 88 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: remove the postfixes and use full paths to the variants instead of glob imports [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/parser/adaptive.rs:57:16 [INFO] [stdout] | [INFO] [stdout] 57 | && !atom.parse::().is_ok() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `atom.parse::().is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/parser/adaptive.rs:58:16 [INFO] [stdout] | [INFO] [stdout] 58 | && !atom.parse::().is_ok() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `atom.parse::().is_err()` [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: name `EOF` contains a capitalized acronym [INFO] [stdout] --> src/parser/adaptive.rs:85:5 [INFO] [stdout] | [INFO] [stdout] 85 | EOF, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter (notice the capitalization): `Eof` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: all variants have the same postfix: `Check` [INFO] [stdout] --> src/grammar/rule.rs:81:1 [INFO] [stdout] | [INFO] [stdout] 81 | / pub enum Condition { [INFO] [stdout] 82 | | /// 类型检查 / Type check [INFO] [stdout] 83 | | TypeCheck(String, String), [INFO] [stdout] 84 | | /// 值检查 / Value check [INFO] [stdout] ... | [INFO] [stdout] 87 | | ContextCheck(String), [INFO] [stdout] 88 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: remove the postfixes and use full paths to the variants instead of glob imports [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/parser/adaptive.rs:824:29 [INFO] [stdout] | [INFO] [stdout] 824 | / ... if !self.check(&Token::RightParen) { [INFO] [stdout] 825 | | ... // 后面还有元素,name 是变量名 [INFO] [stdout] 826 | | ... Some(name.clone()) [INFO] [stdout] 827 | | ... } else { [INFO] [stdout] ... | [INFO] [stdout] 833 | | ... }))); [INFO] [stdout] 834 | | ... } [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] 822 ~ GrammarElement::Atom(name) [INFO] [stdout] 823 | // 检查后面是否还有元素(不是右括号) [INFO] [stdout] 824 ~ if !self.check(&Token::RightParen) => { [INFO] [stdout] 825 | // 后面还有元素,name 是变量名 [INFO] [stdout] 826 | Some(name.clone()) [INFO] [stdout] 827 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/parser/adaptive.rs:57:16 [INFO] [stdout] | [INFO] [stdout] 57 | && !atom.parse::().is_ok() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `atom.parse::().is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/parser/adaptive.rs:58:16 [INFO] [stdout] | [INFO] [stdout] 58 | && !atom.parse::().is_ok() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `atom.parse::().is_err()` [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: name `EOF` contains a capitalized acronym [INFO] [stdout] --> src/parser/adaptive.rs:85:5 [INFO] [stdout] | [INFO] [stdout] 85 | EOF, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter (notice the capitalization): `Eof` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/parser/context.rs:79:25 [INFO] [stdout] | [INFO] [stdout] 79 | / if let GrammarElement::Atom(name) = first { [INFO] [stdout] 80 | | // 存储函数定义 / Store function definition [INFO] [stdout] 81 | | self.functions.insert(name.clone(), intent.clone()); [INFO] [stdout] 82 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/parser/context.rs:78:33 [INFO] [stdout] | [INFO] [stdout] 78 | if let Some(first) = intent.code_structure.first() { [INFO] [stdout] | ^^^^^ replace this binding [INFO] [stdout] 79 | if let GrammarElement::Atom(name) = first { [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` can be collapsed into the outer `match` [INFO] [stdout] --> src/parser/adaptive.rs:824:29 [INFO] [stdout] | [INFO] [stdout] 824 | / ... if !self.check(&Token::RightParen) { [INFO] [stdout] 825 | | ... // 后面还有元素,name 是变量名 [INFO] [stdout] 826 | | ... Some(name.clone()) [INFO] [stdout] 827 | | ... } else { [INFO] [stdout] ... | [INFO] [stdout] 833 | | ... }))); [INFO] [stdout] 834 | | ... } [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] 822 ~ GrammarElement::Atom(name) [INFO] [stdout] 823 | // 检查后面是否还有元素(不是右括号) [INFO] [stdout] 824 ~ if !self.check(&Token::RightParen) => { [INFO] [stdout] 825 | // 后面还有元素,name 是变量名 [INFO] [stdout] 826 | Some(name.clone()) [INFO] [stdout] 827 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/parser/explainer.rs:86:23 [INFO] [stdout] | [INFO] [stdout] 86 | if i == 0 { [INFO] [stdout] | _______________________^ [INFO] [stdout] 87 | | parts.push(self.explain(elem)); [INFO] [stdout] 88 | | } else { [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/parser/explainer.rs:88:20 [INFO] [stdout] | [INFO] [stdout] 88 | } else { [INFO] [stdout] | ____________________^ [INFO] [stdout] 89 | | parts.push(self.explain(elem)); [INFO] [stdout] 90 | | } [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] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/parser/context.rs:79:25 [INFO] [stdout] | [INFO] [stdout] 79 | / if let GrammarElement::Atom(name) = first { [INFO] [stdout] 80 | | // 存储函数定义 / Store function definition [INFO] [stdout] 81 | | self.functions.insert(name.clone(), intent.clone()); [INFO] [stdout] 82 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/parser/context.rs:78:33 [INFO] [stdout] | [INFO] [stdout] 78 | if let Some(first) = intent.code_structure.first() { [INFO] [stdout] | ^^^^^ replace this binding [INFO] [stdout] 79 | if let GrammarElement::Atom(name) = first { [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: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/parser/nlu.rs:466:9 [INFO] [stdout] | [INFO] [stdout] 466 | if let Some(func_name) = self.extract_function_name(input).ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] = note: `#[warn(clippy::match_result_ok)]` on by default [INFO] [stdout] help: consider matching on `Ok(func_name)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 466 - if let Some(func_name) = self.extract_function_name(input).ok() { [INFO] [stdout] 466 + if let Ok(func_name) = self.extract_function_name(input) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/parser/explainer.rs:86:23 [INFO] [stdout] | [INFO] [stdout] 86 | if i == 0 { [INFO] [stdout] | _______________________^ [INFO] [stdout] 87 | | parts.push(self.explain(elem)); [INFO] [stdout] 88 | | } else { [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/parser/explainer.rs:88:20 [INFO] [stdout] | [INFO] [stdout] 88 | } else { [INFO] [stdout] | ____________________^ [INFO] [stdout] 89 | | parts.push(self.explain(elem)); [INFO] [stdout] 90 | | } [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] [INFO] [stdout] [INFO] [stdout] warning: this manual char comparison can be written more succinctly [INFO] [stdout] --> src/parser/nlu.rs:497:20 [INFO] [stdout] | [INFO] [stdout] 497 | .split(|c: char| c == ',' || c == ',' || c == ' ' || c == '(' || c == ')') [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an array of `char`: `[',', ',', ' ', '(', ')']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison [INFO] [stdout] = note: `#[warn(clippy::manual_pattern_char_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/parser/nlu.rs:466:9 [INFO] [stdout] | [INFO] [stdout] 466 | if let Some(func_name) = self.extract_function_name(input).ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] = note: `#[warn(clippy::match_result_ok)]` on by default [INFO] [stdout] help: consider matching on `Ok(func_name)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 466 - if let Some(func_name) = self.extract_function_name(input).ok() { [INFO] [stdout] 466 + if let Ok(func_name) = self.extract_function_name(input) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this manual char comparison can be written more succinctly [INFO] [stdout] --> src/parser/nlu.rs:497:20 [INFO] [stdout] | [INFO] [stdout] 497 | .split(|c: char| c == ',' || c == ',' || c == ' ' || c == '(' || c == ')') [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an array of `char`: `[',', ',', ' ', '(', ')']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison [INFO] [stdout] = note: `#[warn(clippy::manual_pattern_char_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/poetry/parser.rs:156:9 [INFO] [stdout] | [INFO] [stdout] 156 | imagery.sort_by(|a, b| b.frequency.cmp(&a.frequency)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 156 - imagery.sort_by(|a, b| b.frequency.cmp(&a.frequency)); [INFO] [stdout] 156 + imagery.sort_by_key(|b| std::cmp::Reverse(b.frequency)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `as_ref` does nothing [INFO] [stdout] --> src/python/bridge.rs:107:74 [INFO] [stdout] | [INFO] [stdout] 107 | let py_tuple = PyTuple::new_bound(py, py_args.iter().map(|a| a.as_ref())); [INFO] [stdout] | ^^^^^^^^^^ help: try: `a` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref [INFO] [stdout] = note: `#[warn(clippy::useless_asref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/python/bridge.rs:199:47 [INFO] [stdout] | [INFO] [stdout] 199 | PyValue::List(list.iter().map(|v| PyValue::from_evo_value(v)).collect()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `PyValue::from_evo_value` [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: parameter is only used in recursion [INFO] [stdout] --> src/python/bridge.rs:293:5 [INFO] [stdout] | [INFO] [stdout] 293 | py: Python<'py>, [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_py` [INFO] [stdout] | [INFO] [stdout] note: parameter used here [INFO] [stdout] --> src/python/bridge.rs:328:50 [INFO] [stdout] | [INFO] [stdout] 328 | list.push(pyobject_to_py_value_bound(py, &item)?); [INFO] [stdout] | ^^ [INFO] [stdout] ... [INFO] [stdout] 340 | dict.insert(key_str, pyobject_to_py_value_bound(py, &value)?); [INFO] [stdout] | ^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion [INFO] [stdout] = note: `#[warn(clippy::only_used_in_recursion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/runtime/interpreter.rs:21:22 [INFO] [stdout] | [INFO] [stdout] 21 | lambda_registry: HashMap, GrammarElement, HashMap)>, [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: unneeded `return` statement [INFO] [stdout] --> src/runtime/interpreter.rs:159:21 [INFO] [stdout] | [INFO] [stdout] 159 | / return Err(InterpreterError::runtime_error( [INFO] [stdout] 160 | | "Match expression parsing failed: should be handled at parse time" [INFO] [stdout] 161 | | .to_string(), [INFO] [stdout] 162 | | None, [INFO] [stdout] 163 | | )); [INFO] [stdout] | |______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 159 ~ Err(InterpreterError::runtime_error( [INFO] [stdout] 160 + "Match expression parsing failed: should be handled at parse time" [INFO] [stdout] 161 + .to_string(), [INFO] [stdout] 162 + None, [INFO] [stdout] 163 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/poetry/parser.rs:156:9 [INFO] [stdout] | [INFO] [stdout] 156 | imagery.sort_by(|a, b| b.frequency.cmp(&a.frequency)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 156 - imagery.sort_by(|a, b| b.frequency.cmp(&a.frequency)); [INFO] [stdout] 156 + imagery.sort_by_key(|b| std::cmp::Reverse(b.frequency)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `as_ref` does nothing [INFO] [stdout] --> src/python/bridge.rs:107:74 [INFO] [stdout] | [INFO] [stdout] 107 | let py_tuple = PyTuple::new_bound(py, py_args.iter().map(|a| a.as_ref())); [INFO] [stdout] | ^^^^^^^^^^ help: try: `a` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref [INFO] [stdout] = note: `#[warn(clippy::useless_asref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/python/bridge.rs:199:47 [INFO] [stdout] | [INFO] [stdout] 199 | PyValue::List(list.iter().map(|v| PyValue::from_evo_value(v)).collect()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `PyValue::from_evo_value` [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: parameter is only used in recursion [INFO] [stdout] --> src/python/bridge.rs:293:5 [INFO] [stdout] | [INFO] [stdout] 293 | py: Python<'py>, [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_py` [INFO] [stdout] | [INFO] [stdout] note: parameter used here [INFO] [stdout] --> src/python/bridge.rs:328:50 [INFO] [stdout] | [INFO] [stdout] 328 | list.push(pyobject_to_py_value_bound(py, &item)?); [INFO] [stdout] | ^^ [INFO] [stdout] ... [INFO] [stdout] 340 | dict.insert(key_str, pyobject_to_py_value_bound(py, &value)?); [INFO] [stdout] | ^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion [INFO] [stdout] = note: `#[warn(clippy::only_used_in_recursion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/runtime/interpreter.rs:21:22 [INFO] [stdout] | [INFO] [stdout] 21 | lambda_registry: HashMap, GrammarElement, HashMap)>, [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: unneeded `return` statement [INFO] [stdout] --> src/runtime/interpreter.rs:159:21 [INFO] [stdout] | [INFO] [stdout] 159 | / return Err(InterpreterError::runtime_error( [INFO] [stdout] 160 | | "Match expression parsing failed: should be handled at parse time" [INFO] [stdout] 161 | | .to_string(), [INFO] [stdout] 162 | | None, [INFO] [stdout] 163 | | )); [INFO] [stdout] | |______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 159 ~ Err(InterpreterError::runtime_error( [INFO] [stdout] 160 + "Match expression parsing failed: should be handled at parse time" [INFO] [stdout] 161 + .to_string(), [INFO] [stdout] 162 + None, [INFO] [stdout] 163 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/runtime/interpreter.rs:2212:21 [INFO] [stdout] | [INFO] [stdout] 2212 | / return Err(InterpreterError::type_error( [INFO] [stdout] 2213 | | "list-concat requires all lists or all strings".to_string(), [INFO] [stdout] 2214 | | None, [INFO] [stdout] 2215 | | )); [INFO] [stdout] | |______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 2212 ~ Err(InterpreterError::type_error( [INFO] [stdout] 2213 + "list-concat requires all lists or all strings".to_string(), [INFO] [stdout] 2214 + None, [INFO] [stdout] 2215 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/runtime/interpreter.rs:2678:20 [INFO] [stdout] | [INFO] [stdout] 2678 | if args.len() < 1 || args.len() > 2 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `args.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/runtime/interpreter.rs:2212:21 [INFO] [stdout] | [INFO] [stdout] 2212 | / return Err(InterpreterError::type_error( [INFO] [stdout] 2213 | | "list-concat requires all lists or all strings".to_string(), [INFO] [stdout] 2214 | | None, [INFO] [stdout] 2215 | | )); [INFO] [stdout] | |______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 2212 ~ Err(InterpreterError::type_error( [INFO] [stdout] 2213 + "list-concat requires all lists or all strings".to_string(), [INFO] [stdout] 2214 + None, [INFO] [stdout] 2215 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/runtime/jit_interpreter.rs:86:9 [INFO] [stdout] | [INFO] [stdout] 86 | / if self.jit_compiler.is_hot_spot(&code_key) { [INFO] [stdout] 87 | | if self.jit_compiler.get_compiled_code(&code_key).is_none() { [INFO] [stdout] 88 | | if let Err(e) = self.jit_compiler.compile_hot_spot(&code_key, ast) { [INFO] [stdout] 89 | | eprintln!("JIT compilation failed: {:?}", e); [INFO] [stdout] ... | [INFO] [stdout] 92 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 86 ~ if self.jit_compiler.is_hot_spot(&code_key) [INFO] [stdout] 87 ~ && self.jit_compiler.get_compiled_code(&code_key).is_none() { [INFO] [stdout] 88 | if let Err(e) = self.jit_compiler.compile_hot_spot(&code_key, ast) { [INFO] [stdout] 89 | eprintln!("JIT compilation failed: {:?}", e); [INFO] [stdout] 90 | } [INFO] [stdout] 91 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/runtime/mode.rs:105:1 [INFO] [stdout] | [INFO] [stdout] 105 | / impl Default for ExecutionMetrics { [INFO] [stdout] 106 | | fn default() -> Self { [INFO] [stdout] 107 | | Self { [INFO] [stdout] 108 | | optimization_opportunities: 0, [INFO] [stdout] ... | [INFO] [stdout] 112 | | } [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] 98 + #[derive(Default)] [INFO] [stdout] 99 | pub struct ExecutionMetrics { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/runtime/interpreter.rs:2678:20 [INFO] [stdout] | [INFO] [stdout] 2678 | if args.len() < 1 || args.len() > 2 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `args.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/main.rs:757:59 [INFO] [stdout] | [INFO] [stdout] 757 | let items_str: Vec = items.iter().map(|item| format_expr(item)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `format_expr` [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 `if` statement can be collapsed [INFO] [stdout] --> src/runtime/jit_interpreter.rs:86:9 [INFO] [stdout] | [INFO] [stdout] 86 | / if self.jit_compiler.is_hot_spot(&code_key) { [INFO] [stdout] 87 | | if self.jit_compiler.get_compiled_code(&code_key).is_none() { [INFO] [stdout] 88 | | if let Err(e) = self.jit_compiler.compile_hot_spot(&code_key, ast) { [INFO] [stdout] 89 | | eprintln!("JIT compilation failed: {:?}", e); [INFO] [stdout] ... | [INFO] [stdout] 92 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 86 ~ if self.jit_compiler.is_hot_spot(&code_key) [INFO] [stdout] 87 ~ && self.jit_compiler.get_compiled_code(&code_key).is_none() { [INFO] [stdout] 88 | if let Err(e) = self.jit_compiler.compile_hot_spot(&code_key, ast) { [INFO] [stdout] 89 | eprintln!("JIT compilation failed: {:?}", e); [INFO] [stdout] 90 | } [INFO] [stdout] 91 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/runtime/mode.rs:105:1 [INFO] [stdout] | [INFO] [stdout] 105 | / impl Default for ExecutionMetrics { [INFO] [stdout] 106 | | fn default() -> Self { [INFO] [stdout] 107 | | Self { [INFO] [stdout] 108 | | optimization_opportunities: 0, [INFO] [stdout] ... | [INFO] [stdout] 112 | | } [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] 98 + #[derive(Default)] [INFO] [stdout] 99 | pub struct ExecutionMetrics { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `format!` in `println!` args [INFO] [stdout] --> src/main.rs:1951:21 [INFO] [stdout] | [INFO] [stdout] 1951 | / println!( [INFO] [stdout] 1952 | | " {}. [{}] {}", [INFO] [stdout] 1953 | | i + 1, [INFO] [stdout] 1954 | | format!("{:?}", suggestion.priority), [INFO] [stdout] 1955 | | suggestion.description [INFO] [stdout] 1956 | | ); [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: combine the `format!(..)` arguments with the outer `println!(..)` call [INFO] [stdout] = help: or consider changing `format!` to `format_args!` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/main.rs:757:59 [INFO] [stdout] | [INFO] [stdout] 757 | let items_str: Vec = items.iter().map(|item| format_expr(item)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `format_expr` [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: `format!` in `println!` args [INFO] [stdout] --> src/main.rs:1951:21 [INFO] [stdout] | [INFO] [stdout] 1951 | / println!( [INFO] [stdout] 1952 | | " {}. [{}] {}", [INFO] [stdout] 1953 | | i + 1, [INFO] [stdout] 1954 | | format!("{:?}", suggestion.priority), [INFO] [stdout] 1955 | | suggestion.description [INFO] [stdout] 1956 | | ); [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: combine the `format!(..)` arguments with the outer `println!(..)` call [INFO] [stdout] = help: or consider changing `format!` to `format_args!` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 43.41s [INFO] running `Command { std: "docker" "inspect" "69520f0c13da3c365582368f09bb8b072672c1fa629b285d5bbf16be91ec37ae", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "69520f0c13da3c365582368f09bb8b072672c1fa629b285d5bbf16be91ec37ae", kill_on_drop: false }` [INFO] [stdout] 69520f0c13da3c365582368f09bb8b072672c1fa629b285d5bbf16be91ec37ae