[INFO] fetching crate agent-office 0.1.36... [INFO] linting agent-office-0.1.36 against nightly for clippy-nonminimal_bool-denied [INFO] extracting crate agent-office 0.1.36 into /workspace/builds/worker-4-tc1/source [INFO] started tweaking crates.io crate agent-office 0.1.36 [INFO] removed 0 missing tests [INFO] finished tweaking crates.io crate agent-office 0.1.36 [INFO] tweaked toml for crates.io crate agent-office 0.1.36 written to /workspace/builds/worker-4-tc1/source/Cargo.toml [INFO] validating manifest of crates.io crate agent-office 0.1.36 on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate crates.io crate agent-office 0.1.36 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] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-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] 42a463a4340a645cf11eca41ac66fde23a440acd106b1aa823686a8e0caaacd5 [INFO] running `Command { std: "docker" "start" "-a" "42a463a4340a645cf11eca41ac66fde23a440acd106b1aa823686a8e0caaacd5", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "42a463a4340a645cf11eca41ac66fde23a440acd106b1aa823686a8e0caaacd5", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "42a463a4340a645cf11eca41ac66fde23a440acd106b1aa823686a8e0caaacd5", kill_on_drop: false }` [INFO] [stdout] 42a463a4340a645cf11eca41ac66fde23a440acd106b1aa823686a8e0caaacd5 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-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] e63f75fbe9855e33f9c9c295b63dfe966360acd108cd5f3d91c11f310cc5bbfb [INFO] running `Command { std: "docker" "start" "-a" "e63f75fbe9855e33f9c9c295b63dfe966360acd108cd5f3d91c11f310cc5bbfb", kill_on_drop: false }` [INFO] [stderr] Compiling serde v1.0.228 [INFO] [stderr] Compiling serde_core v1.0.228 [INFO] [stderr] Compiling stable_deref_trait v1.2.1 [INFO] [stderr] Compiling crossbeam-utils v0.8.21 [INFO] [stderr] Compiling libc v0.2.180 [INFO] [stderr] Checking errno v0.3.14 [INFO] [stderr] Checking socket2 v0.6.2 [INFO] [stderr] Checking mio v1.1.1 [INFO] [stderr] Compiling writeable v0.6.2 [INFO] [stderr] Compiling litemap v0.8.1 [INFO] [stderr] Compiling zerofrom v0.1.6 [INFO] [stderr] Compiling subtle v2.6.1 [INFO] [stderr] Compiling pin-project-lite v0.2.16 [INFO] [stderr] Compiling icu_normalizer_data v2.1.1 [INFO] [stderr] Compiling icu_properties_data v2.1.2 [INFO] [stderr] Compiling futures-core v0.3.31 [INFO] [stderr] Checking crypto-common v0.1.7 [INFO] [stderr] Compiling scopeguard v1.2.0 [INFO] [stderr] Checking signal-hook-registry v1.4.8 [INFO] [stderr] Checking tracing v0.1.44 [INFO] [stderr] Checking digest v0.10.7 [INFO] [stderr] Compiling yoke v0.8.1 [INFO] [stderr] Compiling lock_api v0.4.14 [INFO] [stderr] Compiling zerocopy v0.8.39 [INFO] [stderr] Compiling num-traits v0.2.19 [INFO] [stderr] Compiling bytes v1.11.1 [INFO] [stderr] Compiling percent-encoding v2.3.2 [INFO] [stderr] Compiling memchr v2.8.0 [INFO] [stderr] Compiling tinyvec_macros v0.1.1 [INFO] [stderr] Compiling futures-sink v0.3.31 [INFO] [stderr] Compiling utf8_iter v1.0.4 [INFO] [stderr] Compiling hashbrown v0.15.5 [INFO] [stderr] Checking futures-util v0.3.31 [INFO] [stderr] Compiling zerovec v0.11.5 [INFO] [stderr] Compiling zerotrie v0.2.3 [INFO] [stderr] Compiling tinyvec v1.10.0 [INFO] [stderr] Compiling tracing-core v0.1.36 [INFO] [stderr] Compiling form_urlencoded v1.2.2 [INFO] [stderr] Compiling zmij v1.0.20 [INFO] [stderr] Compiling getrandom v0.2.17 [INFO] [stderr] Compiling rand_core v0.6.4 [INFO] [stderr] Compiling iana-time-zone v0.1.65 [INFO] [stderr] Compiling parking v2.2.1 [INFO] [stderr] Checking smallvec v1.15.1 [INFO] [stderr] Compiling concurrent-queue v2.5.0 [INFO] [stderr] Compiling itoa v1.0.17 [INFO] [stderr] Compiling futures-io v0.3.31 [INFO] [stderr] Compiling tinystr v0.8.2 [INFO] [stderr] Compiling potential_utf v0.1.4 [INFO] [stderr] Checking parking_lot_core v0.9.12 [INFO] [stderr] Checking icu_normalizer v2.1.1 [INFO] [stderr] Compiling slab v0.4.12 [INFO] [stderr] Compiling futures-task v0.3.31 [INFO] [stderr] Compiling crc-catalog v2.4.0 [INFO] [stderr] Compiling indexmap v2.13.0 [INFO] [stderr] Compiling icu_collections v2.1.1 [INFO] [stderr] Checking parking_lot v0.12.5 [INFO] [stderr] Compiling icu_locale_core v2.1.1 [INFO] [stderr] Compiling crc v3.4.0 [INFO] [stderr] Compiling event-listener v5.4.1 [INFO] [stderr] Compiling tokio v1.49.0 [INFO] [stderr] Checking idna_adapter v1.2.1 [INFO] [stderr] Compiling crossbeam-queue v0.3.12 [INFO] [stderr] Compiling unicode-normalization v0.1.25 [INFO] [stderr] Compiling sha2 v0.10.9 [INFO] [stderr] Compiling hashlink v0.10.0 [INFO] [stderr] Compiling hmac v0.12.1 [INFO] [stderr] Compiling thiserror v2.0.18 [INFO] [stderr] Compiling chrono v0.4.43 [INFO] [stderr] Compiling uuid v1.20.0 [INFO] [stderr] Compiling base64 v0.22.1 [INFO] [stderr] Compiling unicode-properties v0.1.4 [INFO] [stderr] Compiling unicode-bidi v0.3.18 [INFO] [stderr] Checking idna v1.1.0 [INFO] [stderr] Compiling hkdf v0.12.4 [INFO] [stderr] Compiling atoi v2.0.0 [INFO] [stderr] Compiling md-5 v0.10.6 [INFO] [stderr] Compiling futures-channel v0.3.31 [INFO] [stderr] Compiling bitflags v2.10.0 [INFO] [stderr] Compiling byteorder v1.5.0 [INFO] [stderr] Compiling dotenvy v0.15.7 [INFO] [stderr] Compiling whoami v1.6.1 [INFO] [stderr] Compiling home v0.5.12 [INFO] [stderr] Compiling stringprep v0.1.5 [INFO] [stderr] Compiling icu_provider v2.1.1 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking url v2.5.8 [INFO] [stderr] Checking futures-intrusive v0.5.0 [INFO] [stderr] Checking either v1.15.0 [INFO] [stderr] Compiling icu_properties v2.1.2 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Compiling pulldown-cmark v0.12.2 [INFO] [stderr] Checking clap_lex v0.7.7 [INFO] [stderr] Checking getopts v0.2.24 [INFO] [stderr] Checking serde_urlencoded v0.7.1 [INFO] [stderr] Checking axum-core v0.5.6 [INFO] [stderr] Compiling serde_json v1.0.149 [INFO] [stderr] Checking clap_builder v4.5.57 [INFO] [stderr] Compiling clap_derive v4.5.55 [INFO] [stderr] Compiling axum-macros v0.5.0 [INFO] [stderr] Checking winnow v0.6.26 [INFO] [stderr] Checking pulldown-cmark-escape v0.11.0 [INFO] [stderr] Compiling async-trait v0.1.89 [INFO] [stderr] Compiling ppv-lite86 v0.2.21 [INFO] [stderr] Checking cron v0.15.0 [INFO] [stderr] Checking clap v4.5.57 [INFO] [stderr] Checking tokio-stream v0.1.18 [INFO] [stderr] Checking hyper v1.8.1 [INFO] [stderr] Checking tokio-util v0.7.18 [INFO] [stderr] Checking tower v0.5.3 [INFO] [stderr] Checking sqlx-core v0.8.6 [INFO] [stderr] Checking tokio-test v0.4.5 [INFO] [stderr] Checking tower-http v0.6.8 [INFO] [stderr] Checking hyper-util v0.1.20 [INFO] [stderr] Checking axum v0.8.8 [INFO] [stderr] Checking sqlx-postgres v0.8.6 [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 agent-office v0.1.36 (/opt/rustwide/workdir) [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/services/kb/domain.rs:79:21 [INFO] [stdout] | [INFO] [stdout] 79 | if let Some(next_char) = (*c as u8 + 1).try_into().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(next_char)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 79 - if let Some(next_char) = (*c as u8 + 1).try_into().ok() { [INFO] [stdout] 79 + if let Ok(next_char) = (*c as u8 + 1).try_into() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of a fallible conversion when an infallible one could be used [INFO] [stdout] --> src/services/kb/domain.rs:79:61 [INFO] [stdout] | [INFO] [stdout] 79 | if let Some(next_char) = (*c as u8 + 1).try_into().ok() { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: converting `u8` to `char` cannot fail [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fallible_conversions)]` on by default [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 79 - if let Some(next_char) = (*c as u8 + 1).try_into().ok() { [INFO] [stdout] 79 + if let Some(next_char) = (*c as u8 + 1).into().ok() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/services/kb/domain.rs:232:23 [INFO] [stdout] | [INFO] [stdout] 232 | .and_then(|s| LuhmannId::parse(s))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `LuhmannId::parse` [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: you should consider adding a `Default` implementation for `NoteCounter` [INFO] [stdout] --> src/services/kb/domain.rs:298:5 [INFO] [stdout] | [INFO] [stdout] 298 | / pub fn new() -> Self { [INFO] [stdout] 299 | | Self { [INFO] [stdout] 300 | | next_main_id: 1, [INFO] [stdout] 301 | | created_at: Utc::now(), [INFO] [stdout] 302 | | } [INFO] [stdout] 303 | | } [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] 297 + impl Default for NoteCounter { [INFO] [stdout] 298 + fn default() -> Self { [INFO] [stdout] 299 + Self::new() [INFO] [stdout] 300 + } [INFO] [stdout] 301 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/services/kb/domain.rs:324:28 [INFO] [stdout] | [INFO] [stdout] 324 | let next_main_id = node [INFO] [stdout] | ____________________________^ [INFO] [stdout] 325 | | .get_property("next_main_id") [INFO] [stdout] 326 | | .and_then(|v| match v { [INFO] [stdout] 327 | | PropertyValue::Integer(n) => Some(*n as u32), [INFO] [stdout] 328 | | _ => Some(1), [INFO] [stdout] 329 | | }) [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] help: use `map` instead [INFO] [stdout] | [INFO] [stdout] 326 ~ .map(|v| match v { [INFO] [stdout] 327 ~ PropertyValue::Integer(n) => *n as u32, [INFO] [stdout] 328 ~ _ => 1, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/services/kb/mod.rs:381:35 [INFO] [stdout] | [INFO] [stdout] 381 | .and_then(|s| LuhmannId::parse(s)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `LuhmannId::parse` [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/services/mail/mod.rs:266:9 [INFO] [stdout] | [INFO] [stdout] 266 | mails.sort_by(|a, b| b.created_at.cmp(&a.created_at)); [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] 266 - mails.sort_by(|a, b| b.created_at.cmp(&a.created_at)); [INFO] [stdout] 266 + mails.sort_by_key(|b| std::cmp::Reverse(b.created_at)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/services/mail/mod.rs:292:9 [INFO] [stdout] | [INFO] [stdout] 292 | mails.sort_by(|a, b| b.created_at.cmp(&a.created_at)); [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] 292 - mails.sort_by(|a, b| b.created_at.cmp(&a.created_at)); [INFO] [stdout] 292 + mails.sort_by_key(|b| std::cmp::Reverse(b.created_at)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/storage/memory.rs:186:17 [INFO] [stdout] | [INFO] [stdout] 186 | edge_type.map_or(true, |et| edge.edge_type == et) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 186 - edge_type.map_or(true, |et| edge.edge_type == et) [INFO] [stdout] 186 + edge_type.is_none_or(|et| edge.edge_type == et) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/storage/memory.rs:199:17 [INFO] [stdout] | [INFO] [stdout] 199 | edge_type.map_or(true, |et| edge.edge_type == et) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 199 - edge_type.map_or(true, |et| edge.edge_type == et) [INFO] [stdout] 199 + edge_type.is_none_or(|et| edge.edge_type == et) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/storage/memory.rs:218:32 [INFO] [stdout] | [INFO] [stdout] 218 | let matches_type = edge_type.map_or(true, |et| edge.edge_type == et); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 218 - let matches_type = edge_type.map_or(true, |et| edge.edge_type == et); [INFO] [stdout] 218 + let matches_type = edge_type.is_none_or(|et| edge.edge_type == et); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's values [INFO] [stdout] --> src/storage/postgres.rs:174:27 [INFO] [stdout] | [INFO] [stdout] 174 | for (_, value) in properties { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] = note: `#[warn(clippy::for_kv_map)]` on by default [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 174 - for (_, value) in properties { [INFO] [stdout] 174 + for value in properties.values() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/storage/postgres.rs:455:9 [INFO] [stdout] | [INFO] [stdout] 455 | / match direction { [INFO] [stdout] 456 | | EdgeDirection::Outgoing => { [INFO] [stdout] 457 | | let edges = self.get_edges_from(node_id, edge_type).await?; [INFO] [stdout] 458 | | for edge in edges { [INFO] [stdout] ... | [INFO] [stdout] 464 | | _ => {} [INFO] [stdout] 465 | | } [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] 455 ~ if direction == EdgeDirection::Outgoing { [INFO] [stdout] 456 + let edges = self.get_edges_from(node_id, edge_type).await?; [INFO] [stdout] 457 + for edge in edges { [INFO] [stdout] 458 + if let Ok(node) = self.get_node(edge.to_node_id).await { [INFO] [stdout] 459 + neighbors.push(node); [INFO] [stdout] 460 + } [INFO] [stdout] 461 + } [INFO] [stdout] 462 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/storage/postgres.rs:467:9 [INFO] [stdout] | [INFO] [stdout] 467 | / match direction { [INFO] [stdout] 468 | | EdgeDirection::Incoming => { [INFO] [stdout] 469 | | let edges = self.get_edges_to(node_id, edge_type).await?; [INFO] [stdout] 470 | | for edge in edges { [INFO] [stdout] ... | [INFO] [stdout] 476 | | _ => {} [INFO] [stdout] 477 | | } [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] help: try [INFO] [stdout] | [INFO] [stdout] 467 ~ if direction == EdgeDirection::Incoming { [INFO] [stdout] 468 + let edges = self.get_edges_to(node_id, edge_type).await?; [INFO] [stdout] 469 + for edge in edges { [INFO] [stdout] 470 + if let Ok(node) = self.get_node(edge.from_node_id).await { [INFO] [stdout] 471 + neighbors.push(node); [INFO] [stdout] 472 + } [INFO] [stdout] 473 + } [INFO] [stdout] 474 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/services/kb/domain.rs:79:21 [INFO] [stdout] | [INFO] [stdout] 79 | if let Some(next_char) = (*c as u8 + 1).try_into().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(next_char)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 79 - if let Some(next_char) = (*c as u8 + 1).try_into().ok() { [INFO] [stdout] 79 + if let Ok(next_char) = (*c as u8 + 1).try_into() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of a fallible conversion when an infallible one could be used [INFO] [stdout] --> src/services/kb/domain.rs:79:61 [INFO] [stdout] | [INFO] [stdout] 79 | if let Some(next_char) = (*c as u8 + 1).try_into().ok() { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: converting `u8` to `char` cannot fail [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fallible_conversions)]` on by default [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 79 - if let Some(next_char) = (*c as u8 + 1).try_into().ok() { [INFO] [stdout] 79 + if let Some(next_char) = (*c as u8 + 1).into().ok() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/services/kb/domain.rs:232:23 [INFO] [stdout] | [INFO] [stdout] 232 | .and_then(|s| LuhmannId::parse(s))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `LuhmannId::parse` [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: you should consider adding a `Default` implementation for `NoteCounter` [INFO] [stdout] --> src/services/kb/domain.rs:298:5 [INFO] [stdout] | [INFO] [stdout] 298 | / pub fn new() -> Self { [INFO] [stdout] 299 | | Self { [INFO] [stdout] 300 | | next_main_id: 1, [INFO] [stdout] 301 | | created_at: Utc::now(), [INFO] [stdout] 302 | | } [INFO] [stdout] 303 | | } [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] 297 + impl Default for NoteCounter { [INFO] [stdout] 298 + fn default() -> Self { [INFO] [stdout] 299 + Self::new() [INFO] [stdout] 300 + } [INFO] [stdout] 301 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/services/kb/domain.rs:324:28 [INFO] [stdout] | [INFO] [stdout] 324 | let next_main_id = node [INFO] [stdout] | ____________________________^ [INFO] [stdout] 325 | | .get_property("next_main_id") [INFO] [stdout] 326 | | .and_then(|v| match v { [INFO] [stdout] 327 | | PropertyValue::Integer(n) => Some(*n as u32), [INFO] [stdout] 328 | | _ => Some(1), [INFO] [stdout] 329 | | }) [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] help: use `map` instead [INFO] [stdout] | [INFO] [stdout] 326 ~ .map(|v| match v { [INFO] [stdout] 327 ~ PropertyValue::Integer(n) => *n as u32, [INFO] [stdout] 328 ~ _ => 1, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/services/kb/mod.rs:381:35 [INFO] [stdout] | [INFO] [stdout] 381 | .and_then(|s| LuhmannId::parse(s)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `LuhmannId::parse` [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/services/mail/mod.rs:266:9 [INFO] [stdout] | [INFO] [stdout] 266 | mails.sort_by(|a, b| b.created_at.cmp(&a.created_at)); [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] 266 - mails.sort_by(|a, b| b.created_at.cmp(&a.created_at)); [INFO] [stdout] 266 + mails.sort_by_key(|b| std::cmp::Reverse(b.created_at)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/services/mail/mod.rs:292:9 [INFO] [stdout] | [INFO] [stdout] 292 | mails.sort_by(|a, b| b.created_at.cmp(&a.created_at)); [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] 292 - mails.sort_by(|a, b| b.created_at.cmp(&a.created_at)); [INFO] [stdout] 292 + mails.sort_by_key(|b| std::cmp::Reverse(b.created_at)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/storage/memory.rs:186:17 [INFO] [stdout] | [INFO] [stdout] 186 | edge_type.map_or(true, |et| edge.edge_type == et) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 186 - edge_type.map_or(true, |et| edge.edge_type == et) [INFO] [stdout] 186 + edge_type.is_none_or(|et| edge.edge_type == et) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/storage/memory.rs:199:17 [INFO] [stdout] | [INFO] [stdout] 199 | edge_type.map_or(true, |et| edge.edge_type == et) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 199 - edge_type.map_or(true, |et| edge.edge_type == et) [INFO] [stdout] 199 + edge_type.is_none_or(|et| edge.edge_type == et) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/storage/memory.rs:218:32 [INFO] [stdout] | [INFO] [stdout] 218 | let matches_type = edge_type.map_or(true, |et| edge.edge_type == et); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 218 - let matches_type = edge_type.map_or(true, |et| edge.edge_type == et); [INFO] [stdout] 218 + let matches_type = edge_type.is_none_or(|et| edge.edge_type == et); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's values [INFO] [stdout] --> src/storage/postgres.rs:174:27 [INFO] [stdout] | [INFO] [stdout] 174 | for (_, value) in properties { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] = note: `#[warn(clippy::for_kv_map)]` on by default [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 174 - for (_, value) in properties { [INFO] [stdout] 174 + for value in properties.values() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/storage/postgres.rs:455:9 [INFO] [stdout] | [INFO] [stdout] 455 | / match direction { [INFO] [stdout] 456 | | EdgeDirection::Outgoing => { [INFO] [stdout] 457 | | let edges = self.get_edges_from(node_id, edge_type).await?; [INFO] [stdout] 458 | | for edge in edges { [INFO] [stdout] ... | [INFO] [stdout] 464 | | _ => {} [INFO] [stdout] 465 | | } [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] 455 ~ if direction == EdgeDirection::Outgoing { [INFO] [stdout] 456 + let edges = self.get_edges_from(node_id, edge_type).await?; [INFO] [stdout] 457 + for edge in edges { [INFO] [stdout] 458 + if let Ok(node) = self.get_node(edge.to_node_id).await { [INFO] [stdout] 459 + neighbors.push(node); [INFO] [stdout] 460 + } [INFO] [stdout] 461 + } [INFO] [stdout] 462 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/storage/postgres.rs:467:9 [INFO] [stdout] | [INFO] [stdout] 467 | / match direction { [INFO] [stdout] 468 | | EdgeDirection::Incoming => { [INFO] [stdout] 469 | | let edges = self.get_edges_to(node_id, edge_type).await?; [INFO] [stdout] 470 | | for edge in edges { [INFO] [stdout] ... | [INFO] [stdout] 476 | | _ => {} [INFO] [stdout] 477 | | } [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] help: try [INFO] [stdout] | [INFO] [stdout] 467 ~ if direction == EdgeDirection::Incoming { [INFO] [stdout] 468 + let edges = self.get_edges_to(node_id, edge_type).await?; [INFO] [stdout] 469 + for edge in edges { [INFO] [stdout] 470 + if let Ok(node) = self.get_node(edge.from_node_id).await { [INFO] [stdout] 471 + neighbors.push(node); [INFO] [stdout] 472 + } [INFO] [stdout] 473 + } [INFO] [stdout] 474 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/services/kb/domain.rs:79:21 [INFO] [stdout] | [INFO] [stdout] 79 | if let Some(next_char) = (*c as u8 + 1).try_into().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(next_char)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 79 - if let Some(next_char) = (*c as u8 + 1).try_into().ok() { [INFO] [stdout] 79 + if let Ok(next_char) = (*c as u8 + 1).try_into() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of a fallible conversion when an infallible one could be used [INFO] [stdout] --> src/services/kb/domain.rs:79:61 [INFO] [stdout] | [INFO] [stdout] 79 | if let Some(next_char) = (*c as u8 + 1).try_into().ok() { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: converting `u8` to `char` cannot fail [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fallible_conversions)]` on by default [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 79 - if let Some(next_char) = (*c as u8 + 1).try_into().ok() { [INFO] [stdout] 79 + if let Some(next_char) = (*c as u8 + 1).into().ok() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/services/kb/domain.rs:232:23 [INFO] [stdout] | [INFO] [stdout] 232 | .and_then(|s| LuhmannId::parse(s))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `LuhmannId::parse` [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: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/services/kb/domain.rs:324:28 [INFO] [stdout] | [INFO] [stdout] 324 | let next_main_id = node [INFO] [stdout] | ____________________________^ [INFO] [stdout] 325 | | .get_property("next_main_id") [INFO] [stdout] 326 | | .and_then(|v| match v { [INFO] [stdout] 327 | | PropertyValue::Integer(n) => Some(*n as u32), [INFO] [stdout] 328 | | _ => Some(1), [INFO] [stdout] 329 | | }) [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] help: use `map` instead [INFO] [stdout] | [INFO] [stdout] 326 ~ .map(|v| match v { [INFO] [stdout] 327 ~ PropertyValue::Integer(n) => *n as u32, [INFO] [stdout] 328 ~ _ => 1, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/services/kb/mod.rs:381:35 [INFO] [stdout] | [INFO] [stdout] 381 | .and_then(|s| LuhmannId::parse(s)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `LuhmannId::parse` [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/services/mail/mod.rs:266:9 [INFO] [stdout] | [INFO] [stdout] 266 | mails.sort_by(|a, b| b.created_at.cmp(&a.created_at)); [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] 266 - mails.sort_by(|a, b| b.created_at.cmp(&a.created_at)); [INFO] [stdout] 266 + mails.sort_by_key(|b| std::cmp::Reverse(b.created_at)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/services/mail/mod.rs:292:9 [INFO] [stdout] | [INFO] [stdout] 292 | mails.sort_by(|a, b| b.created_at.cmp(&a.created_at)); [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] 292 - mails.sort_by(|a, b| b.created_at.cmp(&a.created_at)); [INFO] [stdout] 292 + mails.sort_by_key(|b| std::cmp::Reverse(b.created_at)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/services/kb/domain.rs:79:21 [INFO] [stdout] | [INFO] [stdout] 79 | if let Some(next_char) = (*c as u8 + 1).try_into().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(next_char)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 79 - if let Some(next_char) = (*c as u8 + 1).try_into().ok() { [INFO] [stdout] 79 + if let Ok(next_char) = (*c as u8 + 1).try_into() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of a fallible conversion when an infallible one could be used [INFO] [stdout] --> src/services/kb/domain.rs:79:61 [INFO] [stdout] | [INFO] [stdout] 79 | if let Some(next_char) = (*c as u8 + 1).try_into().ok() { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: converting `u8` to `char` cannot fail [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fallible_conversions)]` on by default [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 79 - if let Some(next_char) = (*c as u8 + 1).try_into().ok() { [INFO] [stdout] 79 + if let Some(next_char) = (*c as u8 + 1).into().ok() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/storage/memory.rs:186:17 [INFO] [stdout] | [INFO] [stdout] 186 | edge_type.map_or(true, |et| edge.edge_type == et) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 186 - edge_type.map_or(true, |et| edge.edge_type == et) [INFO] [stdout] 186 + edge_type.is_none_or(|et| edge.edge_type == et) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/storage/memory.rs:199:17 [INFO] [stdout] | [INFO] [stdout] 199 | edge_type.map_or(true, |et| edge.edge_type == et) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 199 - edge_type.map_or(true, |et| edge.edge_type == et) [INFO] [stdout] 199 + edge_type.is_none_or(|et| edge.edge_type == et) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/services/kb/domain.rs:232:23 [INFO] [stdout] | [INFO] [stdout] 232 | .and_then(|s| LuhmannId::parse(s))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `LuhmannId::parse` [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: this `map_or` can be simplified [INFO] [stdout] --> src/storage/memory.rs:218:32 [INFO] [stdout] | [INFO] [stdout] 218 | let matches_type = edge_type.map_or(true, |et| edge.edge_type == et); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 218 - let matches_type = edge_type.map_or(true, |et| edge.edge_type == et); [INFO] [stdout] 218 + let matches_type = edge_type.is_none_or(|et| edge.edge_type == et); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's values [INFO] [stdout] --> src/storage/postgres.rs:174:27 [INFO] [stdout] | [INFO] [stdout] 174 | for (_, value) in properties { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] = note: `#[warn(clippy::for_kv_map)]` on by default [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 174 - for (_, value) in properties { [INFO] [stdout] 174 + for value in properties.values() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/services/kb/domain.rs:324:28 [INFO] [stdout] | [INFO] [stdout] 324 | let next_main_id = node [INFO] [stdout] | ____________________________^ [INFO] [stdout] 325 | | .get_property("next_main_id") [INFO] [stdout] 326 | | .and_then(|v| match v { [INFO] [stdout] 327 | | PropertyValue::Integer(n) => Some(*n as u32), [INFO] [stdout] 328 | | _ => Some(1), [INFO] [stdout] 329 | | }) [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] help: use `map` instead [INFO] [stdout] | [INFO] [stdout] 326 ~ .map(|v| match v { [INFO] [stdout] 327 ~ PropertyValue::Integer(n) => *n as u32, [INFO] [stdout] 328 ~ _ => 1, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/storage/postgres.rs:455:9 [INFO] [stdout] | [INFO] [stdout] 455 | / match direction { [INFO] [stdout] 456 | | EdgeDirection::Outgoing => { [INFO] [stdout] 457 | | let edges = self.get_edges_from(node_id, edge_type).await?; [INFO] [stdout] 458 | | for edge in edges { [INFO] [stdout] ... | [INFO] [stdout] 464 | | _ => {} [INFO] [stdout] 465 | | } [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] 455 ~ if direction == EdgeDirection::Outgoing { [INFO] [stdout] 456 + let edges = self.get_edges_from(node_id, edge_type).await?; [INFO] [stdout] 457 + for edge in edges { [INFO] [stdout] 458 + if let Ok(node) = self.get_node(edge.to_node_id).await { [INFO] [stdout] 459 + neighbors.push(node); [INFO] [stdout] 460 + } [INFO] [stdout] 461 + } [INFO] [stdout] 462 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/storage/postgres.rs:467:9 [INFO] [stdout] | [INFO] [stdout] 467 | / match direction { [INFO] [stdout] 468 | | EdgeDirection::Incoming => { [INFO] [stdout] 469 | | let edges = self.get_edges_to(node_id, edge_type).await?; [INFO] [stdout] 470 | | for edge in edges { [INFO] [stdout] ... | [INFO] [stdout] 476 | | _ => {} [INFO] [stdout] 477 | | } [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] help: try [INFO] [stdout] | [INFO] [stdout] 467 ~ if direction == EdgeDirection::Incoming { [INFO] [stdout] 468 + let edges = self.get_edges_to(node_id, edge_type).await?; [INFO] [stdout] 469 + for edge in edges { [INFO] [stdout] 470 + if let Ok(node) = self.get_node(edge.from_node_id).await { [INFO] [stdout] 471 + neighbors.push(node); [INFO] [stdout] 472 + } [INFO] [stdout] 473 + } [INFO] [stdout] 474 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/services/kb/mod.rs:381:35 [INFO] [stdout] | [INFO] [stdout] 381 | .and_then(|s| LuhmannId::parse(s)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `LuhmannId::parse` [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: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/web/schedules.rs:23:25 [INFO] [stdout] | [INFO] [stdout] 23 | let schedules = match schedule_service.list_schedules_by_agent(&agent_id).await { [INFO] [stdout] | _________________________^ [INFO] [stdout] 24 | | Ok(s) => s, [INFO] [stdout] 25 | | Err(_) => vec![], [INFO] [stdout] 26 | | }; [INFO] [stdout] | |_________^ help: ascribe the type std::vec::Vec and replace your expression with: `schedule_service.list_schedules_by_agent(&agent_id).await.unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::manual_unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/web/mod.rs:43:17 [INFO] [stdout] | [INFO] [stdout] 43 | / if !text.is_empty() { [INFO] [stdout] 44 | | text.push(' '); [INFO] [stdout] 45 | | } [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] 42 ~ Event::Start(Tag::Paragraph) [INFO] [stdout] 43 ~ if !text.is_empty() => { [INFO] [stdout] 44 | text.push(' '); [INFO] [stdout] 45 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/web/mod.rs:557:25 [INFO] [stdout] | [INFO] [stdout] 557 | let all_notes = match service.list_notes().await { [INFO] [stdout] | _________________________^ [INFO] [stdout] 558 | | Ok(n) => n, [INFO] [stdout] 559 | | Err(_) => vec![], [INFO] [stdout] 560 | | }; [INFO] [stdout] | |_________^ help: ascribe the type std::vec::Vec and replace your expression with: `service.list_notes().await.unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/web/mod.rs:604:25 [INFO] [stdout] | [INFO] [stdout] 604 | let all_notes = match service.list_notes().await { [INFO] [stdout] | _________________________^ [INFO] [stdout] 605 | | Ok(n) => n, [INFO] [stdout] 606 | | Err(_) => vec![], [INFO] [stdout] 607 | | }; [INFO] [stdout] | |_________^ help: ascribe the type std::vec::Vec and replace your expression with: `service.list_notes().await.unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Option` [INFO] [stdout] --> src/web/mod.rs:907:10 [INFO] [stdout] | [INFO] [stdout] 907 | .map(|s| urlencoding::decode(s).ok()) [INFO] [stdout] | __________^ [INFO] [stdout] 908 | | .flatten() [INFO] [stdout] | |__________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|s| urlencoding::decode(s).ok())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/web/mod.rs:960:20 [INFO] [stdout] | [INFO] [stdout] 960 | let mail = match service.get_mailbox_inbox(mailbox.id).await { [INFO] [stdout] | ____________________^ [INFO] [stdout] 961 | | Ok(m) => m, [INFO] [stdout] 962 | | Err(_) => vec![], [INFO] [stdout] 963 | | }; [INFO] [stdout] | |_________^ help: ascribe the type std::vec::Vec and replace your expression with: `service.get_mailbox_inbox(mailbox.id).await.unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/web/mod.rs:980:20 [INFO] [stdout] | [INFO] [stdout] 980 | let mail = match service.get_mailbox_inbox(mailbox.id).await { [INFO] [stdout] | ____________________^ [INFO] [stdout] 981 | | Ok(m) => m, [INFO] [stdout] 982 | | Err(_) => vec![], [INFO] [stdout] 983 | | }; [INFO] [stdout] | |_________^ help: ascribe the type std::vec::Vec and replace your expression with: `service.get_mailbox_inbox(mailbox.id).await.unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/web/mod.rs:1082:20 [INFO] [stdout] | [INFO] [stdout] 1082 | let mail = match service.get_mailbox_outbox(mailbox.id).await { [INFO] [stdout] | ____________________^ [INFO] [stdout] 1083 | | Ok(m) => m, [INFO] [stdout] 1084 | | Err(_) => vec![], [INFO] [stdout] 1085 | | }; [INFO] [stdout] | |_________^ help: ascribe the type std::vec::Vec and replace your expression with: `service.get_mailbox_outbox(mailbox.id).await.unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/web/mod.rs:1102:20 [INFO] [stdout] | [INFO] [stdout] 1102 | let mail = match service.get_mailbox_outbox(mailbox.id).await { [INFO] [stdout] | ____________________^ [INFO] [stdout] 1103 | | Ok(m) => m, [INFO] [stdout] 1104 | | Err(_) => vec![], [INFO] [stdout] 1105 | | }; [INFO] [stdout] | |_________^ help: ascribe the type std::vec::Vec and replace your expression with: `service.get_mailbox_outbox(mailbox.id).await.unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/web/mod.rs:1188:21 [INFO] [stdout] | [INFO] [stdout] 1188 | return Html(format!( [INFO] [stdout] | _____________________^ [INFO] [stdout] 1189 | | r#"
Error: To and body are required
"# [INFO] [stdout] 1190 | | )); [INFO] [stdout] | |_________^ help: consider using `.to_string()`: `r#"
Error: To and body are required
"#.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/web/mod.rs:1231:24 [INFO] [stdout] | [INFO] [stdout] 1231 | Err(_) => Html(format!( [INFO] [stdout] | ________________________^ [INFO] [stdout] 1232 | | r#"
✗ Failed to send message
"# [INFO] [stdout] 1233 | | )), [INFO] [stdout] | |_________^ help: consider using `.to_string()`: `r#"
✗ Failed to send message
"#.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 pattern matching, consider using `is_ok()` [INFO] [stdout] --> src/web/mod.rs:1289:40 [INFO] [stdout] | [INFO] [stdout] 1289 | ... if let Ok(_) = service.mark_mail_as_read(m.id).await { [INFO] [stdout] | -------^^^^^---------------------------------------- help: try: `if service.mark_mail_as_read(m.id).await.is_ok()` [INFO] [stdout] | [INFO] [stdout] = note: this will change drop order of the result, as well as all temporaries [INFO] [stdout] = note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_ok()` [INFO] [stdout] --> src/web/mod.rs:1312:40 [INFO] [stdout] | [INFO] [stdout] 1312 | ... if let Ok(_) = service.mark_mail_as_read(m.id).await { [INFO] [stdout] | -------^^^^^---------------------------------------- help: try: `if service.mark_mail_as_read(m.id).await.is_ok()` [INFO] [stdout] | [INFO] [stdout] = note: this will change drop order of the result, as well as all temporaries [INFO] [stdout] = note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/web/mod.rs:1347:17 [INFO] [stdout] | [INFO] [stdout] 1347 | / match service.get_mailbox_inbox(mailbox.id).await { [INFO] [stdout] 1348 | | Ok(mail) => mail, [INFO] [stdout] 1349 | | Err(_) => vec![], [INFO] [stdout] 1350 | | } [INFO] [stdout] | |_________________^ help: ascribe the type std::vec::Vec and replace your expression with: `service.get_mailbox_inbox(mailbox.id).await.unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/web/mod.rs:1360:17 [INFO] [stdout] | [INFO] [stdout] 1360 | / match service.get_mailbox_inbox(mailbox.id).await { [INFO] [stdout] 1361 | | Ok(mail) => mail, [INFO] [stdout] 1362 | | Err(_) => vec![], [INFO] [stdout] 1363 | | } [INFO] [stdout] | |_________________^ help: ascribe the type std::vec::Vec and replace your expression with: `service.get_mailbox_inbox(mailbox.id).await.unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/services/mail/mod.rs:266:9 [INFO] [stdout] | [INFO] [stdout] 266 | mails.sort_by(|a, b| b.created_at.cmp(&a.created_at)); [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] 266 - mails.sort_by(|a, b| b.created_at.cmp(&a.created_at)); [INFO] [stdout] 266 + mails.sort_by_key(|b| std::cmp::Reverse(b.created_at)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/services/mail/mod.rs:292:9 [INFO] [stdout] | [INFO] [stdout] 292 | mails.sort_by(|a, b| b.created_at.cmp(&a.created_at)); [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] 292 - mails.sort_by(|a, b| b.created_at.cmp(&a.created_at)); [INFO] [stdout] 292 + mails.sort_by_key(|b| std::cmp::Reverse(b.created_at)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/main.rs:354:13 [INFO] [stdout] | [INFO] [stdout] 354 | results.sort_by(|a, b| b.created_at.cmp(&a.created_at)); [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] 354 - results.sort_by(|a, b| b.created_at.cmp(&a.created_at)); [INFO] [stdout] 354 + results.sort_by_key(|b| std::cmp::Reverse(b.created_at)); [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/main.rs:473:21 [INFO] [stdout] | [INFO] [stdout] 473 | / for line in reader.lines() { [INFO] [stdout] 474 | | if let Ok(line) = line { [INFO] [stdout] 475 | | println!("{}", line); [INFO] [stdout] 476 | | } [INFO] [stdout] 477 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/main.rs:474:25 [INFO] [stdout] | [INFO] [stdout] 474 | / if let Ok(line) = line { [INFO] [stdout] 475 | | println!("{}", line); [INFO] [stdout] 476 | | } [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] 473 ~ for line in reader.lines().flatten() { [INFO] [stdout] 474 + println!("{}", line); [INFO] [stdout] 475 + } [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/main.rs:481:21 [INFO] [stdout] | [INFO] [stdout] 481 | / for line in reader.lines() { [INFO] [stdout] 482 | | if let Ok(line) = line { [INFO] [stdout] 483 | | println!("{}", line); [INFO] [stdout] 484 | | } [INFO] [stdout] 485 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/main.rs:482:25 [INFO] [stdout] | [INFO] [stdout] 482 | / if let Ok(line) = line { [INFO] [stdout] 483 | | println!("{}", line); [INFO] [stdout] 484 | | } [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] 481 ~ for line in reader.lines().flatten() { [INFO] [stdout] 482 + println!("{}", line); [INFO] [stdout] 483 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/storage/memory.rs:186:17 [INFO] [stdout] | [INFO] [stdout] 186 | edge_type.map_or(true, |et| edge.edge_type == et) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 186 - edge_type.map_or(true, |et| edge.edge_type == et) [INFO] [stdout] 186 + edge_type.is_none_or(|et| edge.edge_type == et) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/storage/memory.rs:199:17 [INFO] [stdout] | [INFO] [stdout] 199 | edge_type.map_or(true, |et| edge.edge_type == et) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 199 - edge_type.map_or(true, |et| edge.edge_type == et) [INFO] [stdout] 199 + edge_type.is_none_or(|et| edge.edge_type == et) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/storage/memory.rs:218:32 [INFO] [stdout] | [INFO] [stdout] 218 | let matches_type = edge_type.map_or(true, |et| edge.edge_type == et); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 218 - let matches_type = edge_type.map_or(true, |et| edge.edge_type == et); [INFO] [stdout] 218 + let matches_type = edge_type.is_none_or(|et| edge.edge_type == et); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's values [INFO] [stdout] --> src/storage/postgres.rs:174:27 [INFO] [stdout] | [INFO] [stdout] 174 | for (_, value) in properties { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] = note: `#[warn(clippy::for_kv_map)]` on by default [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 174 - for (_, value) in properties { [INFO] [stdout] 174 + for value in properties.values() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/storage/postgres.rs:455:9 [INFO] [stdout] | [INFO] [stdout] 455 | / match direction { [INFO] [stdout] 456 | | EdgeDirection::Outgoing => { [INFO] [stdout] 457 | | let edges = self.get_edges_from(node_id, edge_type).await?; [INFO] [stdout] 458 | | for edge in edges { [INFO] [stdout] ... | [INFO] [stdout] 464 | | _ => {} [INFO] [stdout] 465 | | } [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] 455 ~ if direction == EdgeDirection::Outgoing { [INFO] [stdout] 456 + let edges = self.get_edges_from(node_id, edge_type).await?; [INFO] [stdout] 457 + for edge in edges { [INFO] [stdout] 458 + if let Ok(node) = self.get_node(edge.to_node_id).await { [INFO] [stdout] 459 + neighbors.push(node); [INFO] [stdout] 460 + } [INFO] [stdout] 461 + } [INFO] [stdout] 462 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/storage/postgres.rs:467:9 [INFO] [stdout] | [INFO] [stdout] 467 | / match direction { [INFO] [stdout] 468 | | EdgeDirection::Incoming => { [INFO] [stdout] 469 | | let edges = self.get_edges_to(node_id, edge_type).await?; [INFO] [stdout] 470 | | for edge in edges { [INFO] [stdout] ... | [INFO] [stdout] 476 | | _ => {} [INFO] [stdout] 477 | | } [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] help: try [INFO] [stdout] | [INFO] [stdout] 467 ~ if direction == EdgeDirection::Incoming { [INFO] [stdout] 468 + let edges = self.get_edges_to(node_id, edge_type).await?; [INFO] [stdout] 469 + for edge in edges { [INFO] [stdout] 470 + if let Ok(node) = self.get_node(edge.from_node_id).await { [INFO] [stdout] 471 + neighbors.push(node); [INFO] [stdout] 472 + } [INFO] [stdout] 473 + } [INFO] [stdout] 474 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/web/schedules.rs:23:25 [INFO] [stdout] | [INFO] [stdout] 23 | let schedules = match schedule_service.list_schedules_by_agent(&agent_id).await { [INFO] [stdout] | _________________________^ [INFO] [stdout] 24 | | Ok(s) => s, [INFO] [stdout] 25 | | Err(_) => vec![], [INFO] [stdout] 26 | | }; [INFO] [stdout] | |_________^ help: ascribe the type std::vec::Vec and replace your expression with: `schedule_service.list_schedules_by_agent(&agent_id).await.unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::manual_unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/web/mod.rs:43:17 [INFO] [stdout] | [INFO] [stdout] 43 | / if !text.is_empty() { [INFO] [stdout] 44 | | text.push(' '); [INFO] [stdout] 45 | | } [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] 42 ~ Event::Start(Tag::Paragraph) [INFO] [stdout] 43 ~ if !text.is_empty() => { [INFO] [stdout] 44 | text.push(' '); [INFO] [stdout] 45 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/web/mod.rs:557:25 [INFO] [stdout] | [INFO] [stdout] 557 | let all_notes = match service.list_notes().await { [INFO] [stdout] | _________________________^ [INFO] [stdout] 558 | | Ok(n) => n, [INFO] [stdout] 559 | | Err(_) => vec![], [INFO] [stdout] 560 | | }; [INFO] [stdout] | |_________^ help: ascribe the type std::vec::Vec and replace your expression with: `service.list_notes().await.unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/web/mod.rs:604:25 [INFO] [stdout] | [INFO] [stdout] 604 | let all_notes = match service.list_notes().await { [INFO] [stdout] | _________________________^ [INFO] [stdout] 605 | | Ok(n) => n, [INFO] [stdout] 606 | | Err(_) => vec![], [INFO] [stdout] 607 | | }; [INFO] [stdout] | |_________^ help: ascribe the type std::vec::Vec and replace your expression with: `service.list_notes().await.unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Option` [INFO] [stdout] --> src/web/mod.rs:907:10 [INFO] [stdout] | [INFO] [stdout] 907 | .map(|s| urlencoding::decode(s).ok()) [INFO] [stdout] | __________^ [INFO] [stdout] 908 | | .flatten() [INFO] [stdout] | |__________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|s| urlencoding::decode(s).ok())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/web/mod.rs:960:20 [INFO] [stdout] | [INFO] [stdout] 960 | let mail = match service.get_mailbox_inbox(mailbox.id).await { [INFO] [stdout] | ____________________^ [INFO] [stdout] 961 | | Ok(m) => m, [INFO] [stdout] 962 | | Err(_) => vec![], [INFO] [stdout] 963 | | }; [INFO] [stdout] | |_________^ help: ascribe the type std::vec::Vec and replace your expression with: `service.get_mailbox_inbox(mailbox.id).await.unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/web/mod.rs:980:20 [INFO] [stdout] | [INFO] [stdout] 980 | let mail = match service.get_mailbox_inbox(mailbox.id).await { [INFO] [stdout] | ____________________^ [INFO] [stdout] 981 | | Ok(m) => m, [INFO] [stdout] 982 | | Err(_) => vec![], [INFO] [stdout] 983 | | }; [INFO] [stdout] | |_________^ help: ascribe the type std::vec::Vec and replace your expression with: `service.get_mailbox_inbox(mailbox.id).await.unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/web/mod.rs:1082:20 [INFO] [stdout] | [INFO] [stdout] 1082 | let mail = match service.get_mailbox_outbox(mailbox.id).await { [INFO] [stdout] | ____________________^ [INFO] [stdout] 1083 | | Ok(m) => m, [INFO] [stdout] 1084 | | Err(_) => vec![], [INFO] [stdout] 1085 | | }; [INFO] [stdout] | |_________^ help: ascribe the type std::vec::Vec and replace your expression with: `service.get_mailbox_outbox(mailbox.id).await.unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/web/mod.rs:1102:20 [INFO] [stdout] | [INFO] [stdout] 1102 | let mail = match service.get_mailbox_outbox(mailbox.id).await { [INFO] [stdout] | ____________________^ [INFO] [stdout] 1103 | | Ok(m) => m, [INFO] [stdout] 1104 | | Err(_) => vec![], [INFO] [stdout] 1105 | | }; [INFO] [stdout] | |_________^ help: ascribe the type std::vec::Vec and replace your expression with: `service.get_mailbox_outbox(mailbox.id).await.unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/web/mod.rs:1188:21 [INFO] [stdout] | [INFO] [stdout] 1188 | return Html(format!( [INFO] [stdout] | _____________________^ [INFO] [stdout] 1189 | | r#"
Error: To and body are required
"# [INFO] [stdout] 1190 | | )); [INFO] [stdout] | |_________^ help: consider using `.to_string()`: `r#"
Error: To and body are required
"#.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/web/mod.rs:1231:24 [INFO] [stdout] | [INFO] [stdout] 1231 | Err(_) => Html(format!( [INFO] [stdout] | ________________________^ [INFO] [stdout] 1232 | | r#"
✗ Failed to send message
"# [INFO] [stdout] 1233 | | )), [INFO] [stdout] | |_________^ help: consider using `.to_string()`: `r#"
✗ Failed to send message
"#.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 pattern matching, consider using `is_ok()` [INFO] [stdout] --> src/web/mod.rs:1289:40 [INFO] [stdout] | [INFO] [stdout] 1289 | ... if let Ok(_) = service.mark_mail_as_read(m.id).await { [INFO] [stdout] | -------^^^^^---------------------------------------- help: try: `if service.mark_mail_as_read(m.id).await.is_ok()` [INFO] [stdout] | [INFO] [stdout] = note: this will change drop order of the result, as well as all temporaries [INFO] [stdout] = note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_ok()` [INFO] [stdout] --> src/web/mod.rs:1312:40 [INFO] [stdout] | [INFO] [stdout] 1312 | ... if let Ok(_) = service.mark_mail_as_read(m.id).await { [INFO] [stdout] | -------^^^^^---------------------------------------- help: try: `if service.mark_mail_as_read(m.id).await.is_ok()` [INFO] [stdout] | [INFO] [stdout] = note: this will change drop order of the result, as well as all temporaries [INFO] [stdout] = note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/web/mod.rs:1347:17 [INFO] [stdout] | [INFO] [stdout] 1347 | / match service.get_mailbox_inbox(mailbox.id).await { [INFO] [stdout] 1348 | | Ok(mail) => mail, [INFO] [stdout] 1349 | | Err(_) => vec![], [INFO] [stdout] 1350 | | } [INFO] [stdout] | |_________________^ help: ascribe the type std::vec::Vec and replace your expression with: `service.get_mailbox_inbox(mailbox.id).await.unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/web/mod.rs:1360:17 [INFO] [stdout] | [INFO] [stdout] 1360 | / match service.get_mailbox_inbox(mailbox.id).await { [INFO] [stdout] 1361 | | Ok(mail) => mail, [INFO] [stdout] 1362 | | Err(_) => vec![], [INFO] [stdout] 1363 | | } [INFO] [stdout] | |_________________^ help: ascribe the type std::vec::Vec and replace your expression with: `service.get_mailbox_inbox(mailbox.id).await.unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/main.rs:354:13 [INFO] [stdout] | [INFO] [stdout] 354 | results.sort_by(|a, b| b.created_at.cmp(&a.created_at)); [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] 354 - results.sort_by(|a, b| b.created_at.cmp(&a.created_at)); [INFO] [stdout] 354 + results.sort_by_key(|b| std::cmp::Reverse(b.created_at)); [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/main.rs:473:21 [INFO] [stdout] | [INFO] [stdout] 473 | / for line in reader.lines() { [INFO] [stdout] 474 | | if let Ok(line) = line { [INFO] [stdout] 475 | | println!("{}", line); [INFO] [stdout] 476 | | } [INFO] [stdout] 477 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/main.rs:474:25 [INFO] [stdout] | [INFO] [stdout] 474 | / if let Ok(line) = line { [INFO] [stdout] 475 | | println!("{}", line); [INFO] [stdout] 476 | | } [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] 473 ~ for line in reader.lines().flatten() { [INFO] [stdout] 474 + println!("{}", line); [INFO] [stdout] 475 + } [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/main.rs:481:21 [INFO] [stdout] | [INFO] [stdout] 481 | / for line in reader.lines() { [INFO] [stdout] 482 | | if let Ok(line) = line { [INFO] [stdout] 483 | | println!("{}", line); [INFO] [stdout] 484 | | } [INFO] [stdout] 485 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/main.rs:482:25 [INFO] [stdout] | [INFO] [stdout] 482 | / if let Ok(line) = line { [INFO] [stdout] 483 | | println!("{}", line); [INFO] [stdout] 484 | | } [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] 481 ~ for line in reader.lines().flatten() { [INFO] [stdout] 482 + println!("{}", line); [INFO] [stdout] 483 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 55.29s [INFO] running `Command { std: "docker" "inspect" "e63f75fbe9855e33f9c9c295b63dfe966360acd108cd5f3d91c11f310cc5bbfb", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "e63f75fbe9855e33f9c9c295b63dfe966360acd108cd5f3d91c11f310cc5bbfb", kill_on_drop: false }` [INFO] [stdout] e63f75fbe9855e33f9c9c295b63dfe966360acd108cd5f3d91c11f310cc5bbfb