[INFO] cloning repository https://github.com/ochsec/friend [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/ochsec/friend" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fochsec%2Ffriend", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fochsec%2Ffriend'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 485e065752e140d114d20f21fc915b32296adfd0 [INFO] linting ochsec/friend/485e065752e140d114d20f21fc915b32296adfd0 against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fochsec%2Ffriend" "/workspace/builds/worker-0-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-0-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/ochsec/friend [INFO] finished tweaking git repo https://github.com/ochsec/friend [INFO] tweaked toml for git repo https://github.com/ochsec/friend written to /workspace/builds/worker-0-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/ochsec/friend 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/ochsec/friend 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 os_info v3.11.0 [INFO] [stderr] Downloaded locate-locale v0.2.0 [INFO] [stderr] Downloaded grammers-tl-gen v0.7.0 [INFO] [stderr] Downloaded grammers-tl-types v0.7.0 [INFO] [stderr] Downloaded grammers-mtsender v0.7.0 [INFO] [stderr] Downloaded grammers-crypto v0.7.0 [INFO] [stderr] Downloaded grammers-mtproto v0.7.0 [INFO] [stderr] Downloaded hyper-util v0.1.12 [INFO] [stderr] Downloaded glass_pumpkin v1.7.0 [INFO] [stderr] Downloaded grammers-client v0.7.0 [INFO] [stderr] Downloaded grammers-session v0.7.0 [INFO] [stderr] Downloaded grammers-tl-parser v1.1.2 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] fcc44027361306a0522c666a21d2fb0f506b757d65662892dd39382abcc21b89 [INFO] running `Command { std: "docker" "start" "-a" "fcc44027361306a0522c666a21d2fb0f506b757d65662892dd39382abcc21b89", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "fcc44027361306a0522c666a21d2fb0f506b757d65662892dd39382abcc21b89", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "fcc44027361306a0522c666a21d2fb0f506b757d65662892dd39382abcc21b89", kill_on_drop: false }` [INFO] [stdout] fcc44027361306a0522c666a21d2fb0f506b757d65662892dd39382abcc21b89 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 3c3cd4c9c0a1736d6c41bfaf5b96f46416266645fe6c6ce5c2f4a583255c05e6 [INFO] running `Command { std: "docker" "start" "-a" "3c3cd4c9c0a1736d6c41bfaf5b96f46416266645fe6c6ce5c2f4a583255c05e6", kill_on_drop: false }` [INFO] [stderr] Compiling serde v1.0.219 [INFO] [stderr] Compiling cc v1.2.24 [INFO] [stderr] Compiling stable_deref_trait v1.2.0 [INFO] [stderr] Compiling libc v0.2.172 [INFO] [stderr] Compiling num-traits v0.2.19 [INFO] [stderr] Checking parking_lot_core v0.9.10 [INFO] [stderr] Checking signal-hook-registry v1.4.5 [INFO] [stderr] Checking mio v1.0.4 [INFO] [stderr] Checking crypto-common v0.1.6 [INFO] [stderr] Compiling tracing-attributes v0.1.28 [INFO] [stderr] Compiling zerofrom v0.1.6 [INFO] [stderr] Checking hashbrown v0.15.3 [INFO] [stderr] Checking futures-util v0.3.31 [INFO] [stderr] Compiling smallvec v1.15.0 [INFO] [stderr] Compiling crc32fast v1.4.2 [INFO] [stderr] Compiling serde_json v1.0.140 [INFO] [stderr] Compiling futures-core v0.3.31 [INFO] [stderr] Compiling yoke v0.8.0 [INFO] [stderr] Checking parking_lot v0.12.3 [INFO] [stderr] Checking digest v0.10.7 [INFO] [stderr] Compiling grammers-tl-parser v1.1.2 [INFO] [stderr] Compiling typenum v1.18.0 [INFO] [stderr] Compiling zeroize v1.8.1 [INFO] [stderr] Compiling lock_api v0.4.12 [INFO] [stderr] Compiling rustls-pki-types v1.12.0 [INFO] [stderr] Compiling thiserror-impl v2.0.12 [INFO] [stderr] Compiling zerovec v0.11.2 [INFO] [stderr] Checking tokio v1.45.1 [INFO] [stderr] Compiling zerotrie v0.2.2 [INFO] [stderr] Compiling grammers-tl-gen v0.7.0 [INFO] [stderr] Checking sha2 v0.10.9 [INFO] [stderr] Checking indexmap v2.9.0 [INFO] [stderr] Compiling getrandom v0.2.16 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Compiling crossbeam-utils v0.8.21 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Checking icu_properties v2.0.1 [INFO] [stderr] Checking num-integer v0.1.46 [INFO] [stderr] Compiling socket2 v0.5.9 [INFO] [stderr] Checking inout v0.1.4 [INFO] [stderr] Compiling slab v0.4.9 [INFO] [stderr] Compiling futures-io v0.3.31 [INFO] [stderr] Compiling futures-task v0.3.31 [INFO] [stderr] Compiling bytes v1.10.1 [INFO] [stderr] Checking cipher v0.4.4 [INFO] [stderr] Checking num-bigint v0.4.6 [INFO] [stderr] Compiling tinystr v0.8.1 [INFO] [stderr] Compiling potential_utf v0.1.2 [INFO] [stderr] Compiling concurrent-queue v2.5.0 [INFO] [stderr] Compiling generic-array v0.14.7 [INFO] [stderr] Checking idna_adapter v1.2.1 [INFO] [stderr] Compiling icu_locale_core v2.0.0 [INFO] [stderr] Compiling icu_collections v2.0.0 [INFO] [stderr] Compiling grammers-tl-types v0.7.0 [INFO] [stderr] Compiling tracing-core v0.1.33 [INFO] [stderr] Checking tracing v0.1.41 [INFO] [stderr] Compiling ring v0.17.14 [INFO] [stderr] Compiling openssl-sys v0.9.108 [INFO] [stderr] Compiling libsqlite3-sys v0.30.1 [INFO] [stderr] Compiling webpki-roots v1.0.0 [INFO] [stderr] Checking hmac v0.12.1 [INFO] [stderr] Checking core2 v0.4.0 [INFO] [stderr] Compiling parking v2.2.1 [INFO] [stderr] Compiling openssl v0.10.72 [INFO] [stderr] Compiling iana-time-zone v0.1.63 [INFO] [stderr] Compiling chrono v0.4.41 [INFO] [stderr] Compiling event-listener v5.4.0 [INFO] [stderr] Checking idna v1.0.3 [INFO] [stderr] Compiling block-buffer v0.10.4 [INFO] [stderr] Compiling either v1.15.0 [INFO] [stderr] Checking glass_pumpkin v1.7.0 [INFO] [stderr] Compiling crc v3.3.0 [INFO] [stderr] Checking pbkdf2 v0.12.2 [INFO] [stderr] Compiling icu_provider v2.0.0 [INFO] [stderr] Compiling webpki-roots v0.26.11 [INFO] [stderr] Compiling futures-intrusive v0.5.0 [INFO] [stderr] Checking aes v0.8.4 [INFO] [stderr] Compiling thiserror v2.0.12 [INFO] [stderr] Compiling hashlink v0.10.0 [INFO] [stderr] Compiling icu_normalizer v2.0.0 [INFO] [stderr] Compiling crossbeam-queue v0.3.12 [INFO] [stderr] Checking sha1 v0.10.6 [INFO] [stderr] Compiling spin v0.9.8 [INFO] [stderr] Compiling openssl-macros v0.1.1 [INFO] [stderr] Compiling uuid v1.17.0 [INFO] [stderr] Compiling base64 v0.22.1 [INFO] [stderr] Compiling darling_core v0.20.11 [INFO] [stderr] Compiling native-tls v0.2.14 [INFO] [stderr] Checking miniz_oxide v0.8.8 [INFO] [stderr] Checking grammers-crypto v0.7.0 [INFO] [stderr] Compiling flume v0.11.1 [INFO] [stderr] Checking url v2.5.4 [INFO] [stderr] Compiling serde_urlencoded v0.7.1 [INFO] [stderr] Compiling atoi v2.0.0 [INFO] [stderr] Compiling futures-channel v0.3.31 [INFO] [stderr] Compiling futures-executor v0.3.31 [INFO] [stderr] Checking flate2 v1.1.1 [INFO] [stderr] Checking signal-hook v0.3.18 [INFO] [stderr] Compiling grammers-session v0.7.0 [INFO] [stderr] Checking tokio-util v0.7.15 [INFO] [stderr] Checking tokio-stream v0.1.17 [INFO] [stderr] Compiling rustls v0.23.27 [INFO] [stderr] Checking h2 v0.4.10 [INFO] [stderr] Checking signal-hook-mio v0.2.4 [INFO] [stderr] Compiling strum_macros v0.26.4 [INFO] [stderr] Checking itertools v0.13.0 [INFO] [stderr] Checking compact_str v0.8.1 [INFO] [stderr] Checking tower v0.5.2 [INFO] [stderr] Checking crossterm v0.28.1 [INFO] [stderr] Checking lru v0.12.5 [INFO] [stderr] Checking os_info v3.11.0 [INFO] [stderr] Checking locate-locale v0.2.0 [INFO] [stderr] Checking md5 v0.7.0 [INFO] [stderr] Checking futures v0.3.31 [INFO] [stderr] Compiling async-trait v0.1.88 [INFO] [stderr] Compiling darling_macro v0.20.11 [INFO] [stderr] Checking rustls-webpki v0.103.3 [INFO] [stderr] Compiling darling v0.20.11 [INFO] [stderr] Compiling instability v0.3.7 [INFO] [stderr] Checking tokio-native-tls v0.3.1 [INFO] [stderr] Checking unicode-truncate v1.1.0 [INFO] [stderr] Checking strum v0.26.3 [INFO] [stderr] Checking ratatui v0.29.0 [INFO] [stderr] Checking sqlx-core v0.8.6 [INFO] [stderr] Checking hyper v1.6.0 [INFO] [stderr] Checking hyper-util v0.1.12 [INFO] [stderr] Checking hyper-tls v0.6.0 [INFO] [stderr] Checking sqlx-sqlite v0.8.6 [INFO] [stderr] Checking reqwest v0.12.15 [INFO] [stderr] Checking grammers-mtproto v0.7.0 [INFO] [stderr] Checking grammers-mtsender v0.7.0 [INFO] [stderr] Checking grammers-client v0.7.0 [INFO] [stderr] Compiling sqlx-macros-core v0.8.6 [INFO] [stderr] Compiling sqlx-macros v0.8.6 [INFO] [stderr] Checking sqlx v0.8.6 [INFO] [stderr] Checking friend v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: methods `load_cached_messages` and `send_message` are never used [INFO] [stdout] --> src/main.rs:228:14 [INFO] [stdout] | [INFO] [stdout] 96 | impl App { [INFO] [stdout] | -------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 228 | async fn load_cached_messages(&mut self) -> Result<(), Box> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 362 | async fn send_message(&mut self) -> Result<(), Box> { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `send_message` is never used [INFO] [stdout] --> src/integrations/mod.rs:15:14 [INFO] [stdout] | [INFO] [stdout] 12 | pub trait MessageProvider { [INFO] [stdout] | --------------- method in this trait [INFO] [stdout] ... [INFO] [stdout] 15 | async fn send_message(&self, content: &str) -> Result<(), Box>; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `send_to_chat_id` is never used [INFO] [stdout] --> src/integrations/telegram.rs:255:14 [INFO] [stdout] | [INFO] [stdout] 20 | impl TelegramProvider { [INFO] [stdout] | --------------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 255 | async fn send_to_chat_id(&self, content: &str, chat_id: i64) -> Result<(), Box> { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `get_messages_since` is never used [INFO] [stdout] --> src/database.rs:215:18 [INFO] [stdout] | [INFO] [stdout] 10 | impl MessageCache { [INFO] [stdout] | ----------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 215 | pub async fn get_messages_since(&self, since: DateTime, limit: Option) -> Result, sqlx::Error> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/integrations/telegram.rs:145:9 [INFO] [stdout] | [INFO] [stdout] 145 | / if let Some(parent) = Path::new(&self.session_file).parent() { [INFO] [stdout] 146 | | if !parent.exists() { [INFO] [stdout] 147 | | println!("Creating session directory: {:?}", parent); [INFO] [stdout] 148 | | if let Err(e) = std::fs::create_dir_all(parent) { [INFO] [stdout] ... | [INFO] [stdout] 152 | | } [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] 145 ~ if let Some(parent) = Path::new(&self.session_file).parent() [INFO] [stdout] 146 ~ && !parent.exists() { [INFO] [stdout] 147 | println!("Creating session directory: {:?}", parent); [INFO] [stdout] ... [INFO] [stdout] 150 | } [INFO] [stdout] 151 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/integrations/telegram.rs:225:43 [INFO] [stdout] | [INFO] [stdout] 225 | let file_type = match filename.split('.').last().unwrap_or("") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 225 - let file_type = match filename.split('.').last().unwrap_or("") { [INFO] [stdout] 225 + let file_type = match filename.split('.').next_back().unwrap_or("") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/integrations/telegram.rs:314:21 [INFO] [stdout] | [INFO] [stdout] 314 | / if let Some(msg_time) = msg_time { [INFO] [stdout] 315 | | if msg_time < since_time { [INFO] [stdout] 316 | | break; // Messages are in reverse chronological order [INFO] [stdout] 317 | | } [INFO] [stdout] 318 | | } [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] 314 ~ if let Some(msg_time) = msg_time [INFO] [stdout] 315 ~ && msg_time < since_time { [INFO] [stdout] 316 | break; // Messages are in reverse chronological order [INFO] [stdout] 317 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/integrations/telegram.rs:331:9 [INFO] [stdout] | [INFO] [stdout] 331 | messages.sort_by(|a, b| b.timestamp.cmp(&a.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] 331 - messages.sort_by(|a, b| b.timestamp.cmp(&a.timestamp)); [INFO] [stdout] 331 + messages.sort_by_key(|b| std::cmp::Reverse(b.timestamp)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/integrations/telegram.rs:337:9 [INFO] [stdout] | [INFO] [stdout] 337 | / if content.starts_with("Reply to chat ") { [INFO] [stdout] 338 | | if let Some(colon_pos) = content.find(": ") { [INFO] [stdout] 339 | | let chat_part = &content[14..colon_pos]; // Skip "Reply to chat " [INFO] [stdout] 340 | | let message_part = &content[colon_pos + 2..]; // Skip ": " [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] 337 ~ if content.starts_with("Reply to chat ") [INFO] [stdout] 338 ~ && let Some(colon_pos) = content.find(": ") { [INFO] [stdout] 339 | let chat_part = &content[14..colon_pos]; // Skip "Reply to chat " [INFO] [stdout] ... [INFO] [stdout] 344 | } [INFO] [stdout] 345 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/integrations/telegram.rs:438:17 [INFO] [stdout] | [INFO] [stdout] 438 | / if let Some(last_id) = last_message_id { [INFO] [stdout] 439 | | if message_id <= last_id { [INFO] [stdout] 440 | | break; // Messages are in reverse chronological order [INFO] [stdout] 441 | | } [INFO] [stdout] 442 | | } [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] 438 ~ if let Some(last_id) = last_message_id [INFO] [stdout] 439 ~ && message_id <= last_id { [INFO] [stdout] 440 | break; // Messages are in reverse chronological order [INFO] [stdout] 441 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/integrations/telegram.rs:452:9 [INFO] [stdout] | [INFO] [stdout] 452 | messages.sort_by(|a, b| b.timestamp.cmp(&a.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] 452 - messages.sort_by(|a, b| b.timestamp.cmp(&a.timestamp)); [INFO] [stdout] 452 + messages.sort_by_key(|b| std::cmp::Reverse(b.timestamp)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/integrations/discord.rs:53:31 [INFO] [stdout] | [INFO] [stdout] 53 | match filename.split('.').last().unwrap_or("") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 53 - match filename.split('.').last().unwrap_or("") { [INFO] [stdout] 53 + match filename.split('.').next_back().unwrap_or("") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/integrations/discord.rs:110:9 [INFO] [stdout] | [INFO] [stdout] 110 | messages.sort_by(|a, b| b.timestamp.cmp(&a.timestamp)); // Newest first [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] 110 - messages.sort_by(|a, b| b.timestamp.cmp(&a.timestamp)); // Newest first [INFO] [stdout] 110 + messages.sort_by_key(|b| std::cmp::Reverse(b.timestamp)); // Newest first [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/integrations/github.rs:128:9 [INFO] [stdout] | [INFO] [stdout] 128 | all_messages.sort_by(|a, b| b.timestamp.cmp(&a.timestamp)); // Already newest first - keep it [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] 128 - all_messages.sort_by(|a, b| b.timestamp.cmp(&a.timestamp)); // Already newest first - keep it [INFO] [stdout] 128 + all_messages.sort_by_key(|b| std::cmp::Reverse(b.timestamp)); // Already newest first - keep it [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/integrations/mod.rs:51:9 [INFO] [stdout] | [INFO] [stdout] 51 | / for result in results { [INFO] [stdout] 52 | | if let Ok(messages) = result { [INFO] [stdout] 53 | | all_messages.extend(messages); [INFO] [stdout] 54 | | } [INFO] [stdout] 55 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/integrations/mod.rs:52:13 [INFO] [stdout] | [INFO] [stdout] 52 | / if let Ok(messages) = result { [INFO] [stdout] 53 | | all_messages.extend(messages); [INFO] [stdout] 54 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 51 ~ for messages in results.into_iter().flatten() { [INFO] [stdout] 52 + all_messages.extend(messages); [INFO] [stdout] 53 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/integrations/mod.rs:57:9 [INFO] [stdout] | [INFO] [stdout] 57 | all_messages.sort_by(|a, b| b.timestamp.cmp(&a.timestamp)); // Newest first [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] 57 - all_messages.sort_by(|a, b| b.timestamp.cmp(&a.timestamp)); // Newest first [INFO] [stdout] 57 + all_messages.sort_by_key(|b| std::cmp::Reverse(b.timestamp)); // Newest first [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/integrations/mod.rs:81:9 [INFO] [stdout] | [INFO] [stdout] 81 | / for result in results { [INFO] [stdout] 82 | | if let Ok(messages) = result { [INFO] [stdout] 83 | | all_messages.extend(messages); [INFO] [stdout] 84 | | } [INFO] [stdout] 85 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/integrations/mod.rs:82:13 [INFO] [stdout] | [INFO] [stdout] 82 | / if let Ok(messages) = result { [INFO] [stdout] 83 | | all_messages.extend(messages); [INFO] [stdout] 84 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 81 ~ for messages in results.into_iter().flatten() { [INFO] [stdout] 82 + all_messages.extend(messages); [INFO] [stdout] 83 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/integrations/mod.rs:87:9 [INFO] [stdout] | [INFO] [stdout] 87 | all_messages.sort_by(|a, b| b.timestamp.cmp(&a.timestamp)); // Newest first [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] 87 - all_messages.sort_by(|a, b| b.timestamp.cmp(&a.timestamp)); // Newest first [INFO] [stdout] 87 + all_messages.sort_by_key(|b| std::cmp::Reverse(b.timestamp)); // Newest first [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/database.rs:156:19 [INFO] [stdout] | [INFO] [stdout] 156 | .bind(&message.timestamp) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `message.timestamp` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/main.rs:185:13 [INFO] [stdout] | [INFO] [stdout] 185 | cached_messages.sort_by(|a, b| b.timestamp.cmp(&a.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] 185 - cached_messages.sort_by(|a, b| b.timestamp.cmp(&a.timestamp)); [INFO] [stdout] 185 + cached_messages.sort_by_key(|b| std::cmp::Reverse(b.timestamp)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:203:17 [INFO] [stdout] | [INFO] [stdout] 203 | / if let Some(latest_message) = provider_messages.iter().max_by_key(|m| m.id) { [INFO] [stdout] 204 | | if let Err(e) = self.cache.update_sync_state(&provider_key, latest_message.id).await { [INFO] [stdout] 205 | | eprintln!("Warning: Failed to update sync state for {}: {}", provider_key, e); [INFO] [stdout] 206 | | } [INFO] [stdout] 207 | | } [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] 203 ~ if let Some(latest_message) = provider_messages.iter().max_by_key(|m| m.id) [INFO] [stdout] 204 ~ && let Err(e) = self.cache.update_sync_state(&provider_key, latest_message.id).await { [INFO] [stdout] 205 | eprintln!("Warning: Failed to update sync state for {}: {}", provider_key, e); [INFO] [stdout] 206 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:217:16 [INFO] [stdout] | [INFO] [stdout] 217 | } else if let Some(selected) = self.selected_message { [INFO] [stdout] | ________________^ [INFO] [stdout] 218 | | if selected >= self.messages.len() { [INFO] [stdout] 219 | | self.selected_message = Some(self.messages.len() - 1); [INFO] [stdout] 220 | | } [INFO] [stdout] 221 | | } [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] 217 ~ } else if let Some(selected) = self.selected_message [INFO] [stdout] 218 ~ && selected >= self.messages.len() { [INFO] [stdout] 219 | self.selected_message = Some(self.messages.len() - 1); [INFO] [stdout] 220 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:315:9 [INFO] [stdout] | [INFO] [stdout] 315 | / if let Some(selected) = self.selected_message { [INFO] [stdout] 316 | | if selected < self.messages.len() - 1 { [INFO] [stdout] 317 | | self.selected_message = Some(selected + 1); [INFO] [stdout] 318 | | } [INFO] [stdout] 319 | | } [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] 315 ~ if let Some(selected) = self.selected_message [INFO] [stdout] 316 ~ && selected < self.messages.len() - 1 { [INFO] [stdout] 317 | self.selected_message = Some(selected + 1); [INFO] [stdout] 318 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:323:9 [INFO] [stdout] | [INFO] [stdout] 323 | / if let Some(selected) = self.selected_message { [INFO] [stdout] 324 | | if selected > 0 { [INFO] [stdout] 325 | | self.selected_message = Some(selected - 1); [INFO] [stdout] 326 | | } [INFO] [stdout] 327 | | } [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] 323 ~ if let Some(selected) = self.selected_message [INFO] [stdout] 324 ~ && selected > 0 { [INFO] [stdout] 325 | self.selected_message = Some(selected - 1); [INFO] [stdout] 326 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:494:9 [INFO] [stdout] | [INFO] [stdout] 494 | / if app.should_refresh() && !app.input_mode { [INFO] [stdout] 495 | | if let Err(e) = app.refresh_messages().await { [INFO] [stdout] 496 | | eprintln!("Error refreshing messages: {}", e); [INFO] [stdout] 497 | | } [INFO] [stdout] 498 | | } [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] 494 ~ if app.should_refresh() && !app.input_mode [INFO] [stdout] 495 ~ && let Err(e) = app.refresh_messages().await { [INFO] [stdout] 496 | eprintln!("Error refreshing messages: {}", e); [INFO] [stdout] 497 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/main.rs:641:25 [INFO] [stdout] | [INFO] [stdout] 641 | / if key.modifiers.contains(KeyModifiers::SHIFT) { [INFO] [stdout] 642 | | // Shift+Enter to send message (non-blocking) [INFO] [stdout] 643 | | if let Err(e) = app.send_message_non_blocking() { [INFO] [stdout] 644 | | eprintln!("Error sending message: {}", e); [INFO] [stdout] 645 | | } [INFO] [stdout] 646 | | } [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] 640 ~ KeyCode::Enter [INFO] [stdout] 641 ~ if key.modifiers.contains(KeyModifiers::SHIFT) => { [INFO] [stdout] 642 | // Shift+Enter to send message (non-blocking) [INFO] [stdout] ... [INFO] [stdout] 646 | } [INFO] [stdout] 647 ~ // Regular Enter does nothing in input mode [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `load_cached_messages` and `send_message` are never used [INFO] [stdout] --> src/main.rs:228:14 [INFO] [stdout] | [INFO] [stdout] 96 | impl App { [INFO] [stdout] | -------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 228 | async fn load_cached_messages(&mut self) -> Result<(), Box> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 362 | async fn send_message(&mut self) -> Result<(), Box> { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `send_message` is never used [INFO] [stdout] --> src/integrations/mod.rs:15:14 [INFO] [stdout] | [INFO] [stdout] 12 | pub trait MessageProvider { [INFO] [stdout] | --------------- method in this trait [INFO] [stdout] ... [INFO] [stdout] 15 | async fn send_message(&self, content: &str) -> Result<(), Box>; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `send_to_chat_id` is never used [INFO] [stdout] --> src/integrations/telegram.rs:255:14 [INFO] [stdout] | [INFO] [stdout] 20 | impl TelegramProvider { [INFO] [stdout] | --------------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 255 | async fn send_to_chat_id(&self, content: &str, chat_id: i64) -> Result<(), Box> { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `get_messages_since` is never used [INFO] [stdout] --> src/database.rs:215:18 [INFO] [stdout] | [INFO] [stdout] 10 | impl MessageCache { [INFO] [stdout] | ----------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 215 | pub async fn get_messages_since(&self, since: DateTime, limit: Option) -> Result, sqlx::Error> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/integrations/telegram.rs:145:9 [INFO] [stdout] | [INFO] [stdout] 145 | / if let Some(parent) = Path::new(&self.session_file).parent() { [INFO] [stdout] 146 | | if !parent.exists() { [INFO] [stdout] 147 | | println!("Creating session directory: {:?}", parent); [INFO] [stdout] 148 | | if let Err(e) = std::fs::create_dir_all(parent) { [INFO] [stdout] ... | [INFO] [stdout] 152 | | } [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] 145 ~ if let Some(parent) = Path::new(&self.session_file).parent() [INFO] [stdout] 146 ~ && !parent.exists() { [INFO] [stdout] 147 | println!("Creating session directory: {:?}", parent); [INFO] [stdout] ... [INFO] [stdout] 150 | } [INFO] [stdout] 151 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/integrations/telegram.rs:225:43 [INFO] [stdout] | [INFO] [stdout] 225 | let file_type = match filename.split('.').last().unwrap_or("") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 225 - let file_type = match filename.split('.').last().unwrap_or("") { [INFO] [stdout] 225 + let file_type = match filename.split('.').next_back().unwrap_or("") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/integrations/telegram.rs:314:21 [INFO] [stdout] | [INFO] [stdout] 314 | / if let Some(msg_time) = msg_time { [INFO] [stdout] 315 | | if msg_time < since_time { [INFO] [stdout] 316 | | break; // Messages are in reverse chronological order [INFO] [stdout] 317 | | } [INFO] [stdout] 318 | | } [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] 314 ~ if let Some(msg_time) = msg_time [INFO] [stdout] 315 ~ && msg_time < since_time { [INFO] [stdout] 316 | break; // Messages are in reverse chronological order [INFO] [stdout] 317 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/integrations/telegram.rs:331:9 [INFO] [stdout] | [INFO] [stdout] 331 | messages.sort_by(|a, b| b.timestamp.cmp(&a.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] 331 - messages.sort_by(|a, b| b.timestamp.cmp(&a.timestamp)); [INFO] [stdout] 331 + messages.sort_by_key(|b| std::cmp::Reverse(b.timestamp)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/integrations/telegram.rs:337:9 [INFO] [stdout] | [INFO] [stdout] 337 | / if content.starts_with("Reply to chat ") { [INFO] [stdout] 338 | | if let Some(colon_pos) = content.find(": ") { [INFO] [stdout] 339 | | let chat_part = &content[14..colon_pos]; // Skip "Reply to chat " [INFO] [stdout] 340 | | let message_part = &content[colon_pos + 2..]; // Skip ": " [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] 337 ~ if content.starts_with("Reply to chat ") [INFO] [stdout] 338 ~ && let Some(colon_pos) = content.find(": ") { [INFO] [stdout] 339 | let chat_part = &content[14..colon_pos]; // Skip "Reply to chat " [INFO] [stdout] ... [INFO] [stdout] 344 | } [INFO] [stdout] 345 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/integrations/telegram.rs:438:17 [INFO] [stdout] | [INFO] [stdout] 438 | / if let Some(last_id) = last_message_id { [INFO] [stdout] 439 | | if message_id <= last_id { [INFO] [stdout] 440 | | break; // Messages are in reverse chronological order [INFO] [stdout] 441 | | } [INFO] [stdout] 442 | | } [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] 438 ~ if let Some(last_id) = last_message_id [INFO] [stdout] 439 ~ && message_id <= last_id { [INFO] [stdout] 440 | break; // Messages are in reverse chronological order [INFO] [stdout] 441 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/integrations/telegram.rs:452:9 [INFO] [stdout] | [INFO] [stdout] 452 | messages.sort_by(|a, b| b.timestamp.cmp(&a.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] 452 - messages.sort_by(|a, b| b.timestamp.cmp(&a.timestamp)); [INFO] [stdout] 452 + messages.sort_by_key(|b| std::cmp::Reverse(b.timestamp)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/integrations/discord.rs:53:31 [INFO] [stdout] | [INFO] [stdout] 53 | match filename.split('.').last().unwrap_or("") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 53 - match filename.split('.').last().unwrap_or("") { [INFO] [stdout] 53 + match filename.split('.').next_back().unwrap_or("") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/integrations/discord.rs:110:9 [INFO] [stdout] | [INFO] [stdout] 110 | messages.sort_by(|a, b| b.timestamp.cmp(&a.timestamp)); // Newest first [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] 110 - messages.sort_by(|a, b| b.timestamp.cmp(&a.timestamp)); // Newest first [INFO] [stdout] 110 + messages.sort_by_key(|b| std::cmp::Reverse(b.timestamp)); // Newest first [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/integrations/github.rs:128:9 [INFO] [stdout] | [INFO] [stdout] 128 | all_messages.sort_by(|a, b| b.timestamp.cmp(&a.timestamp)); // Already newest first - keep it [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] 128 - all_messages.sort_by(|a, b| b.timestamp.cmp(&a.timestamp)); // Already newest first - keep it [INFO] [stdout] 128 + all_messages.sort_by_key(|b| std::cmp::Reverse(b.timestamp)); // Already newest first - keep it [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/integrations/mod.rs:51:9 [INFO] [stdout] | [INFO] [stdout] 51 | / for result in results { [INFO] [stdout] 52 | | if let Ok(messages) = result { [INFO] [stdout] 53 | | all_messages.extend(messages); [INFO] [stdout] 54 | | } [INFO] [stdout] 55 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/integrations/mod.rs:52:13 [INFO] [stdout] | [INFO] [stdout] 52 | / if let Ok(messages) = result { [INFO] [stdout] 53 | | all_messages.extend(messages); [INFO] [stdout] 54 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 51 ~ for messages in results.into_iter().flatten() { [INFO] [stdout] 52 + all_messages.extend(messages); [INFO] [stdout] 53 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/integrations/mod.rs:57:9 [INFO] [stdout] | [INFO] [stdout] 57 | all_messages.sort_by(|a, b| b.timestamp.cmp(&a.timestamp)); // Newest first [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] 57 - all_messages.sort_by(|a, b| b.timestamp.cmp(&a.timestamp)); // Newest first [INFO] [stdout] 57 + all_messages.sort_by_key(|b| std::cmp::Reverse(b.timestamp)); // Newest first [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/integrations/mod.rs:81:9 [INFO] [stdout] | [INFO] [stdout] 81 | / for result in results { [INFO] [stdout] 82 | | if let Ok(messages) = result { [INFO] [stdout] 83 | | all_messages.extend(messages); [INFO] [stdout] 84 | | } [INFO] [stdout] 85 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/integrations/mod.rs:82:13 [INFO] [stdout] | [INFO] [stdout] 82 | / if let Ok(messages) = result { [INFO] [stdout] 83 | | all_messages.extend(messages); [INFO] [stdout] 84 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 81 ~ for messages in results.into_iter().flatten() { [INFO] [stdout] 82 + all_messages.extend(messages); [INFO] [stdout] 83 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/integrations/mod.rs:87:9 [INFO] [stdout] | [INFO] [stdout] 87 | all_messages.sort_by(|a, b| b.timestamp.cmp(&a.timestamp)); // Newest first [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] 87 - all_messages.sort_by(|a, b| b.timestamp.cmp(&a.timestamp)); // Newest first [INFO] [stdout] 87 + all_messages.sort_by_key(|b| std::cmp::Reverse(b.timestamp)); // Newest first [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/database.rs:156:19 [INFO] [stdout] | [INFO] [stdout] 156 | .bind(&message.timestamp) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `message.timestamp` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/main.rs:185:13 [INFO] [stdout] | [INFO] [stdout] 185 | cached_messages.sort_by(|a, b| b.timestamp.cmp(&a.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] 185 - cached_messages.sort_by(|a, b| b.timestamp.cmp(&a.timestamp)); [INFO] [stdout] 185 + cached_messages.sort_by_key(|b| std::cmp::Reverse(b.timestamp)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:203:17 [INFO] [stdout] | [INFO] [stdout] 203 | / if let Some(latest_message) = provider_messages.iter().max_by_key(|m| m.id) { [INFO] [stdout] 204 | | if let Err(e) = self.cache.update_sync_state(&provider_key, latest_message.id).await { [INFO] [stdout] 205 | | eprintln!("Warning: Failed to update sync state for {}: {}", provider_key, e); [INFO] [stdout] 206 | | } [INFO] [stdout] 207 | | } [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] 203 ~ if let Some(latest_message) = provider_messages.iter().max_by_key(|m| m.id) [INFO] [stdout] 204 ~ && let Err(e) = self.cache.update_sync_state(&provider_key, latest_message.id).await { [INFO] [stdout] 205 | eprintln!("Warning: Failed to update sync state for {}: {}", provider_key, e); [INFO] [stdout] 206 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:217:16 [INFO] [stdout] | [INFO] [stdout] 217 | } else if let Some(selected) = self.selected_message { [INFO] [stdout] | ________________^ [INFO] [stdout] 218 | | if selected >= self.messages.len() { [INFO] [stdout] 219 | | self.selected_message = Some(self.messages.len() - 1); [INFO] [stdout] 220 | | } [INFO] [stdout] 221 | | } [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] 217 ~ } else if let Some(selected) = self.selected_message [INFO] [stdout] 218 ~ && selected >= self.messages.len() { [INFO] [stdout] 219 | self.selected_message = Some(self.messages.len() - 1); [INFO] [stdout] 220 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:315:9 [INFO] [stdout] | [INFO] [stdout] 315 | / if let Some(selected) = self.selected_message { [INFO] [stdout] 316 | | if selected < self.messages.len() - 1 { [INFO] [stdout] 317 | | self.selected_message = Some(selected + 1); [INFO] [stdout] 318 | | } [INFO] [stdout] 319 | | } [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] 315 ~ if let Some(selected) = self.selected_message [INFO] [stdout] 316 ~ && selected < self.messages.len() - 1 { [INFO] [stdout] 317 | self.selected_message = Some(selected + 1); [INFO] [stdout] 318 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:323:9 [INFO] [stdout] | [INFO] [stdout] 323 | / if let Some(selected) = self.selected_message { [INFO] [stdout] 324 | | if selected > 0 { [INFO] [stdout] 325 | | self.selected_message = Some(selected - 1); [INFO] [stdout] 326 | | } [INFO] [stdout] 327 | | } [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] 323 ~ if let Some(selected) = self.selected_message [INFO] [stdout] 324 ~ && selected > 0 { [INFO] [stdout] 325 | self.selected_message = Some(selected - 1); [INFO] [stdout] 326 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:494:9 [INFO] [stdout] | [INFO] [stdout] 494 | / if app.should_refresh() && !app.input_mode { [INFO] [stdout] 495 | | if let Err(e) = app.refresh_messages().await { [INFO] [stdout] 496 | | eprintln!("Error refreshing messages: {}", e); [INFO] [stdout] 497 | | } [INFO] [stdout] 498 | | } [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] 494 ~ if app.should_refresh() && !app.input_mode [INFO] [stdout] 495 ~ && let Err(e) = app.refresh_messages().await { [INFO] [stdout] 496 | eprintln!("Error refreshing messages: {}", e); [INFO] [stdout] 497 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/main.rs:641:25 [INFO] [stdout] | [INFO] [stdout] 641 | / if key.modifiers.contains(KeyModifiers::SHIFT) { [INFO] [stdout] 642 | | // Shift+Enter to send message (non-blocking) [INFO] [stdout] 643 | | if let Err(e) = app.send_message_non_blocking() { [INFO] [stdout] 644 | | eprintln!("Error sending message: {}", e); [INFO] [stdout] 645 | | } [INFO] [stdout] 646 | | } [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] 640 ~ KeyCode::Enter [INFO] [stdout] 641 ~ if key.modifiers.contains(KeyModifiers::SHIFT) => { [INFO] [stdout] 642 | // Shift+Enter to send message (non-blocking) [INFO] [stdout] ... [INFO] [stdout] 646 | } [INFO] [stdout] 647 ~ // Regular Enter does nothing in input mode [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 04s [INFO] running `Command { std: "docker" "inspect" "3c3cd4c9c0a1736d6c41bfaf5b96f46416266645fe6c6ce5c2f4a583255c05e6", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "3c3cd4c9c0a1736d6c41bfaf5b96f46416266645fe6c6ce5c2f4a583255c05e6", kill_on_drop: false }` [INFO] [stdout] 3c3cd4c9c0a1736d6c41bfaf5b96f46416266645fe6c6ce5c2f4a583255c05e6