[INFO] cloning repository https://github.com/lysender/files-rs [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/lysender/files-rs" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Flysender%2Ffiles-rs", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Flysender%2Ffiles-rs'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] c0236cb22235800acb4fbc69daffac8eb0a5113e [INFO] linting lysender/files-rs against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Flysender%2Ffiles-rs" "/workspace/builds/worker-5-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-5-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/lysender/files-rs [INFO] finished tweaking git repo https://github.com/lysender/files-rs [INFO] tweaked toml for git repo https://github.com/lysender/files-rs written to /workspace/builds/worker-5-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/lysender/files-rs 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/lysender/files-rs 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] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded google-cloud-token v0.1.2 [INFO] [stderr] Downloaded deadpool-diesel v0.6.1 [INFO] [stderr] Downloaded reqwest-middleware v0.4.1 [INFO] [stderr] Downloaded google-cloud-metadata v0.5.1 [INFO] [stderr] Downloaded google-cloud-auth v0.17.2 [INFO] [stderr] Downloaded google-cloud-storage v0.24.0 [INFO] [stderr] Downloaded rustix v1.0.1 [INFO] [stderr] Downloaded ring v0.17.13 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-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] bfe419dc2ecdaeb4931fa722ef30859b07a3eb2bdfca1f88c0f5bd124d277ea1 [INFO] running `Command { std: "docker" "start" "-a" "bfe419dc2ecdaeb4931fa722ef30859b07a3eb2bdfca1f88c0f5bd124d277ea1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "bfe419dc2ecdaeb4931fa722ef30859b07a3eb2bdfca1f88c0f5bd124d277ea1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "bfe419dc2ecdaeb4931fa722ef30859b07a3eb2bdfca1f88c0f5bd124d277ea1", kill_on_drop: false }` [INFO] [stdout] bfe419dc2ecdaeb4931fa722ef30859b07a3eb2bdfca1f88c0f5bd124d277ea1 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-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] ee6908b6f94df42ef91eed5ca2bfc06ecaf5200f238b7b13033d58b07c8eed9c [INFO] running `Command { std: "docker" "start" "-a" "ee6908b6f94df42ef91eed5ca2bfc06ecaf5200f238b7b13033d58b07c8eed9c", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.170 [INFO] [stderr] Checking log v0.4.26 [INFO] [stderr] Compiling cc v1.2.16 [INFO] [stderr] Compiling quote v1.0.39 [INFO] [stderr] Checking http v1.2.0 [INFO] [stderr] Checking tracing-core v0.1.33 [INFO] [stderr] Compiling anyhow v1.0.97 [INFO] [stderr] Compiling unicase v2.8.1 [INFO] [stderr] Checking base64ct v1.6.0 [INFO] [stderr] Compiling time-core v0.1.3 [INFO] [stderr] Compiling thiserror v2.0.12 [INFO] [stderr] Checking rustls-pemfile v2.2.0 [INFO] [stderr] Checking miniz_oxide v0.8.5 [INFO] [stderr] Compiling getrandom v0.3.1 [INFO] [stderr] Compiling libsqlite3-sys v0.31.0 [INFO] [stderr] Compiling time-macros v0.2.20 [INFO] [stderr] Checking zeroize v1.8.1 [INFO] [stderr] Compiling syn v2.0.100 [INFO] [stderr] Compiling mime_guess v2.0.5 [INFO] [stderr] Compiling either v1.15.0 [INFO] [stderr] Compiling multer v3.1.0 [INFO] [stderr] Checking half v2.4.1 [INFO] [stderr] Checking pem-rfc7468 v0.7.0 [INFO] [stderr] Compiling simd_helpers v0.1.0 [INFO] [stderr] Compiling proc-macro-error-attr2 v2.0.0 [INFO] [stderr] Checking home v0.5.11 [INFO] [stderr] Checking flate2 v1.1.0 [INFO] [stderr] Checking winnow v0.7.3 [INFO] [stderr] Checking spin v0.9.8 [INFO] [stderr] Compiling once_cell v1.20.3 [INFO] [stderr] Checking bytemuck v1.22.0 [INFO] [stderr] Checking exr v1.73.0 [INFO] [stderr] Checking der v0.7.9 [INFO] [stderr] Checking clap_builder v4.5.31 [INFO] [stderr] Checking tracing-log v0.2.0 [INFO] [stderr] Checking blake2 v0.10.6 [INFO] [stderr] Checking av1-grain v0.2.3 [INFO] [stderr] Checking qoi v0.4.1 [INFO] [stderr] Checking thread_local v1.1.8 [INFO] [stderr] Checking mutate_once v0.1.1 [INFO] [stderr] Checking tiff v0.9.1 [INFO] [stderr] Checking http-body v1.0.1 [INFO] [stderr] Checking png v0.17.16 [INFO] [stderr] Checking chrono v0.4.40 [INFO] [stderr] Checking tracing-subscriber v0.3.19 [INFO] [stderr] Checking kamadak-exif v0.6.1 [INFO] [stderr] Checking parking_lot_core v0.9.10 [INFO] [stderr] Checking socket2 v0.5.8 [INFO] [stderr] Checking mio v1.0.3 [INFO] [stderr] Checking parking_lot v0.12.3 [INFO] [stderr] Checking signal-hook-registry v1.4.2 [INFO] [stderr] Checking getrandom v0.2.15 [INFO] [stderr] Checking num_cpus v1.16.0 [INFO] [stderr] Checking rtoolbox v0.0.2 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Checking uuid v1.15.1 [INFO] [stderr] Checking rpassword v7.3.1 [INFO] [stderr] Checking password-hash v0.5.0 [INFO] [stderr] Compiling openssl-sys v0.9.106 [INFO] [stderr] Compiling ring v0.17.13 [INFO] [stderr] Checking cfb v0.7.3 [INFO] [stderr] Checking spki v0.7.3 [INFO] [stderr] Checking pkcs8 v0.10.2 [INFO] [stderr] Checking argon2 v0.5.3 [INFO] [stderr] Checking infer v0.19.0 [INFO] [stderr] Compiling openssl v0.10.71 [INFO] [stderr] Compiling native-tls v0.2.14 [INFO] [stderr] Compiling synstructure v0.13.1 [INFO] [stderr] Compiling darling_core v0.20.10 [INFO] [stderr] Compiling diesel_table_macro_syntax v0.2.0 [INFO] [stderr] Compiling proc-macro-error2 v2.0.1 [INFO] [stderr] Compiling zerofrom-derive v0.1.6 [INFO] [stderr] Compiling serde_derive v1.0.219 [INFO] [stderr] Compiling yoke-derive v0.7.5 [INFO] [stderr] Compiling tokio-macros v2.5.0 [INFO] [stderr] Compiling zerovec-derive v0.10.3 [INFO] [stderr] Compiling displaydoc v0.2.5 [INFO] [stderr] Compiling futures-macro v0.3.31 [INFO] [stderr] Compiling icu_provider_macros v1.5.0 [INFO] [stderr] Compiling tracing-attributes v0.1.28 [INFO] [stderr] Compiling openssl-macros v0.1.1 [INFO] [stderr] Compiling thiserror-impl v1.0.69 [INFO] [stderr] Compiling thiserror-impl v2.0.12 [INFO] [stderr] Compiling profiling-procmacros v1.0.16 [INFO] [stderr] Compiling async-trait v0.1.87 [INFO] [stderr] Compiling arg_enum_proc_macro v0.3.4 [INFO] [stderr] Checking profiling v1.0.16 [INFO] [stderr] Compiling num-derive v0.4.2 [INFO] [stderr] Checking tokio v1.44.0 [INFO] [stderr] Compiling async-stream-impl v0.3.6 [INFO] [stderr] Compiling axum-macros v0.5.0 [INFO] [stderr] Compiling derive_more-impl v2.0.1 [INFO] [stderr] Checking futures-util v0.3.31 [INFO] [stderr] Checking async-stream v0.3.6 [INFO] [stderr] Compiling clap_derive v4.5.28 [INFO] [stderr] Checking google-cloud-token v0.1.2 [INFO] [stderr] Checking tracing v0.1.41 [INFO] [stderr] Checking thiserror v1.0.69 [INFO] [stderr] Checking zerofrom v0.1.6 [INFO] [stderr] Checking rav1e v0.7.1 [INFO] [stderr] Checking yoke v0.7.5 [INFO] [stderr] Compiling darling_macro v0.20.10 [INFO] [stderr] Checking zerovec v0.10.4 [INFO] [stderr] Compiling darling v0.20.10 [INFO] [stderr] Compiling dsl_auto_type v0.1.3 [INFO] [stderr] Compiling validator_derive v0.20.0 [INFO] [stderr] Checking http-body-util v0.1.2 [INFO] [stderr] Checking serde v1.0.219 [INFO] [stderr] Compiling diesel_derives v2.2.4 [INFO] [stderr] Checking axum-core v0.5.0 [INFO] [stderr] Checking tower-http v0.6.2 [INFO] [stderr] Checking clap v4.5.31 [INFO] [stderr] Checking tinystr v0.7.6 [INFO] [stderr] Checking icu_collections v1.5.0 [INFO] [stderr] Checking icu_locid v1.5.0 [INFO] [stderr] Checking icu_provider v1.5.0 [INFO] [stderr] Checking icu_locid_transform v1.5.0 [INFO] [stderr] Checking icu_properties v1.5.1 [INFO] [stderr] Checking derive_more v2.0.1 [INFO] [stderr] Checking serde_json v1.0.140 [INFO] [stderr] Checking serde_urlencoded v0.7.1 [INFO] [stderr] Checking deranged v0.3.11 [INFO] [stderr] Checking toml_datetime v0.6.8 [INFO] [stderr] Checking serde_spanned v0.6.8 [INFO] [stderr] Checking serde_path_to_error v0.1.17 [INFO] [stderr] Checking toml_edit v0.22.24 [INFO] [stderr] Checking hyper v1.6.0 [INFO] [stderr] Checking tower v0.5.2 [INFO] [stderr] Checking tokio-native-tls v0.3.1 [INFO] [stderr] Checking tokio-util v0.7.13 [INFO] [stderr] Checking deadpool-runtime v0.1.4 [INFO] [stderr] Checking deadpool v0.12.2 [INFO] [stderr] Checking deadpool-sync v0.1.4 [INFO] [stderr] Checking time v0.3.39 [INFO] [stderr] Checking icu_normalizer v1.5.0 [INFO] [stderr] Checking ravif v0.11.11 [INFO] [stderr] Checking hyper-util v0.1.10 [INFO] [stderr] Checking image v0.25.5 [INFO] [stderr] Checking idna_adapter v1.2.0 [INFO] [stderr] Checking diesel v2.2.8 [INFO] [stderr] Checking idna v1.0.3 [INFO] [stderr] Checking toml v0.8.20 [INFO] [stderr] Checking url v2.5.4 [INFO] [stderr] Checking validator v0.20.0 [INFO] [stderr] Checking hyper-tls v0.6.0 [INFO] [stderr] Checking axum v0.8.1 [INFO] [stderr] Checking simple_asn1 v0.6.3 [INFO] [stderr] Checking reqwest v0.12.12 [INFO] [stderr] Checking jsonwebtoken v9.3.1 [INFO] [stderr] Checking google-cloud-metadata v0.5.1 [INFO] [stderr] Checking reqwest-middleware v0.4.1 [INFO] [stderr] Checking google-cloud-auth v0.17.2 [INFO] [stderr] Checking google-cloud-storage v0.24.0 [INFO] [stderr] Checking deadpool-diesel v0.6.1 [INFO] [stderr] Checking files-rs v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: struct `AuthToken` is never constructed [INFO] [stdout] --> src/auth/models.rs:79:12 [INFO] [stdout] | [INFO] [stdout] 79 | pub struct AuthToken { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ListBucketsParams` is never constructed [INFO] [stdout] --> src/buckets/models.rs:35:12 [INFO] [stdout] | [INFO] [stdout] 35 | pub struct ListBucketsParams { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/auth/models.rs:62:48 [INFO] [stdout] | [INFO] [stdout] 62 | pub fn has_permissions(&self, permissions: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 62 - pub fn has_permissions(&self, permissions: &Vec) -> bool { [INFO] [stdout] 62 + pub fn has_permissions(&self, permissions: &[Permission]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/auth/password.rs:22:45 [INFO] [stdout] | [INFO] [stdout] 22 | let Ok(parsed_hash) = PasswordHash::new(&hash) else { [INFO] [stdout] | ^^^^^ help: change this to: `hash` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/auth/password.rs:42:17 [INFO] [stdout] | [INFO] [stdout] 42 | assert!(hash.len() > 0); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!hash.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/auth/password.rs:50:48 [INFO] [stdout] | [INFO] [stdout] 50 | let result = verify_password(password, &stored_hash); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `stored_hash` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/auth/password.rs:54:48 [INFO] [stdout] | [INFO] [stdout] 54 | let result = verify_password(password, &stored_hash); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `stored_hash` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/auth/queries.rs:44:5 [INFO] [stdout] | [INFO] [stdout] 44 | let _ = verify_password(&credentials.password, &user.password)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] = note: `#[warn(clippy::let_unit_value)]` on by default [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 44 - let _ = verify_password(&credentials.password, &user.password)?; [INFO] [stdout] 44 + verify_password(&credentials.password, &user.password)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> src/auth/queries.rs:76:8 [INFO] [stdout] | [INFO] [stdout] 76 | if &user.client_id != &client.id { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 76 - if &user.client_id != &client.id { [INFO] [stdout] 76 + if user.client_id != client.id { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/auth/token.rs:52:8 [INFO] [stdout] | [INFO] [stdout] 52 | if decoded.claims.sub.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `decoded.claims.sub.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/auth/token.rs:55:8 [INFO] [stdout] | [INFO] [stdout] 55 | if decoded.claims.scope.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `decoded.claims.scope.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/auth/token.rs:81:17 [INFO] [stdout] | [INFO] [stdout] 81 | assert!(token.len() > 0); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!token.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/buckets/commands.rs:68:12 [INFO] [stdout] | [INFO] [stdout] 68 | if let Some(_) = bucket { [INFO] [stdout] | -------^^^^^^^--------- help: try: `if bucket.is_some()` [INFO] [stdout] | [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: this let-binding has unit value [INFO] [stdout] --> src/buckets/commands.rs:69:9 [INFO] [stdout] | [INFO] [stdout] 69 | let _ = delete_bucket(&db_pool, &id).await?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 69 - let _ = delete_bucket(&db_pool, &id).await?; [INFO] [stdout] 69 + delete_bucket(&db_pool, &id).await?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/buckets/queries.rs:71:5 [INFO] [stdout] | [INFO] [stdout] 71 | / let _ = match count_client_buckets(db_pool, client_id).await { [INFO] [stdout] 72 | | Ok(count) => { [INFO] [stdout] 73 | | if count >= MAX_BUCKETS_PER_CLIENT as i64 { [INFO] [stdout] 74 | | return Err(Error::ValidationError( [INFO] [stdout] ... | [INFO] [stdout] 79 | | Err(e) => return Err(e), [INFO] [stdout] 80 | | }; [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 71 - let _ = match count_client_buckets(db_pool, client_id).await { [INFO] [stdout] 71 + match count_client_buckets(db_pool, client_id).await { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/buckets/queries.rs:83:12 [INFO] [stdout] | [INFO] [stdout] 83 | if let Some(_) = find_client_bucket(db_pool, client_id, &data.name).await? { [INFO] [stdout] | -------^^^^^^^------------------------------------------------------------ help: try: `if find_client_bucket(db_pool, client_id, &data.name).await?.is_some()` [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: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/clients/commands.rs:90:12 [INFO] [stdout] | [INFO] [stdout] 90 | if let Some(_) = client { [INFO] [stdout] | -------^^^^^^^--------- help: try: `if client.is_some()` [INFO] [stdout] | [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: this let-binding has unit value [INFO] [stdout] --> src/clients/commands.rs:91:9 [INFO] [stdout] | [INFO] [stdout] 91 | let _ = delete_client(&db_pool, &id).await?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 91 - let _ = delete_client(&db_pool, &id).await?; [INFO] [stdout] 91 + delete_client(&db_pool, &id).await?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/clients/commands.rs:102:12 [INFO] [stdout] | [INFO] [stdout] 102 | if let Some(_) = client { [INFO] [stdout] | -------^^^^^^^--------- help: try: `if client.is_some()` [INFO] [stdout] | [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: this let-binding has unit value [INFO] [stdout] --> src/clients/queries.rs:60:5 [INFO] [stdout] | [INFO] [stdout] 60 | / let _ = match count_clients(db_pool).await { [INFO] [stdout] 61 | | Ok(count) => { [INFO] [stdout] 62 | | if count >= MAX_CLIENTS as i64 { [INFO] [stdout] 63 | | return Err(Error::ValidationError( [INFO] [stdout] ... | [INFO] [stdout] 68 | | Err(e) => return Err(e), [INFO] [stdout] 69 | | }; [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 60 - let _ = match count_clients(db_pool).await { [INFO] [stdout] 60 + match count_clients(db_pool).await { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/clients/queries.rs:72:12 [INFO] [stdout] | [INFO] [stdout] 72 | if let Some(_) = find_client_by_name(db_pool, &data.name).await? { [INFO] [stdout] | -------^^^^^^^-------------------------------------------------- help: try: `if find_client_by_name(db_pool, &data.name).await?.is_some()` [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: length comparison to zero [INFO] [stdout] --> src/config.rs:49:12 [INFO] [stdout] | [INFO] [stdout] 49 | if config.jwt_secret.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `config.jwt_secret.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/config.rs:52:12 [INFO] [stdout] | [INFO] [stdout] 52 | if config.cloud.project_id.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `config.cloud.project_id.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/config.rs:55:12 [INFO] [stdout] | [INFO] [stdout] 55 | if config.cloud.credentials.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `config.cloud.credentials.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/config.rs:58:12 [INFO] [stdout] | [INFO] [stdout] 58 | if config.db.url.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `config.db.url.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/dirs/queries.rs:41:5 [INFO] [stdout] | [INFO] [stdout] 41 | / if let Some(per_page_param) = params.per_page { [INFO] [stdout] 42 | | if per_page_param > 0 && per_page_param <= MAX_PER_PAGE { [INFO] [stdout] 43 | | per_page = per_page_param; [INFO] [stdout] 44 | | } [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_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 41 ~ if let Some(per_page_param) = params.per_page [INFO] [stdout] 42 ~ && per_page_param > 0 && per_page_param <= MAX_PER_PAGE { [INFO] [stdout] 43 | per_page = per_page_param; [INFO] [stdout] 44 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/dirs/queries.rs:68:13 [INFO] [stdout] | [INFO] [stdout] 68 | / if let Some(keyword) = params_copy.keyword { [INFO] [stdout] 69 | | if keyword.len() > 0 { [INFO] [stdout] 70 | | let pattern = format!("%{}%", keyword); [INFO] [stdout] 71 | | query = [INFO] [stdout] ... | [INFO] [stdout] 74 | | } [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] 68 ~ if let Some(keyword) = params_copy.keyword [INFO] [stdout] 69 ~ && keyword.len() > 0 { [INFO] [stdout] 70 | let pattern = format!("%{}%", keyword); [INFO] [stdout] 71 | query = [INFO] [stdout] 72 | query.filter(dsl::name.like(pattern.clone()).or(dsl::label.like(pattern))); [INFO] [stdout] 73 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/dirs/queries.rs:69:20 [INFO] [stdout] | [INFO] [stdout] 69 | if keyword.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!keyword.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/dirs/queries.rs:111:13 [INFO] [stdout] | [INFO] [stdout] 111 | / if let Some(keyword) = params_copy.keyword { [INFO] [stdout] 112 | | if keyword.len() > 0 { [INFO] [stdout] 113 | | let pattern = format!("%{}%", keyword); [INFO] [stdout] 114 | | query = [INFO] [stdout] ... | [INFO] [stdout] 117 | | } [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] 111 ~ if let Some(keyword) = params_copy.keyword [INFO] [stdout] 112 ~ && keyword.len() > 0 { [INFO] [stdout] 113 | let pattern = format!("%{}%", keyword); [INFO] [stdout] 114 | query = [INFO] [stdout] 115 | query.filter(dsl::name.like(pattern.clone()).or(dsl::label.like(pattern))); [INFO] [stdout] 116 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/dirs/queries.rs:112:20 [INFO] [stdout] | [INFO] [stdout] 112 | if keyword.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!keyword.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/dirs/queries.rs:147:5 [INFO] [stdout] | [INFO] [stdout] 147 | / let _ = match count_bucket_dirs(db_pool, bucket_id).await { [INFO] [stdout] 148 | | Ok(count) => { [INFO] [stdout] 149 | | if count >= MAX_DIRS as i64 { [INFO] [stdout] 150 | | return Err(Error::ValidationError( [INFO] [stdout] ... | [INFO] [stdout] 155 | | Err(e) => return Err(e), [INFO] [stdout] 156 | | }; [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 147 - let _ = match count_bucket_dirs(db_pool, bucket_id).await { [INFO] [stdout] 147 + match count_bucket_dirs(db_pool, bucket_id).await { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/dirs/queries.rs:159:12 [INFO] [stdout] | [INFO] [stdout] 159 | if let Some(_) = find_bucket_dir(db_pool, bucket_id, data.name.as_str()).await? { [INFO] [stdout] | -------^^^^^^^----------------------------------------------------------------- help: try: `if find_bucket_dir(db_pool, bucket_id, data.name.as_str()).await?.is_some()` [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: literal with an empty format string [INFO] [stdout] --> src/error.rs:50:57 [INFO] [stdout] | [INFO] [stdout] 50 | Self::FileTypeNotAllowed => write!(f, "{}", "File type not allowed"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [INFO] [stdout] = note: `#[warn(clippy::write_literal)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 50 - Self::FileTypeNotAllowed => write!(f, "{}", "File type not allowed"), [INFO] [stdout] 50 + Self::FileTypeNotAllowed => write!(f, "File type not allowed"), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/files/models.rs:132:20 [INFO] [stdout] | [INFO] [stdout] 132 | if versions.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!versions.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do [INFO] [stdout] --> src/files/models.rs:184:35 [INFO] [stdout] | [INFO] [stdout] 184 | pub fn to_path(&self, prefix: &PathBuf, filename: &str) -> PathBuf { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 184 ~ pub fn to_path(&self, prefix: &Path, filename: &str) -> PathBuf { [INFO] [stdout] 185 ~ prefix.to_path_buf().join(self.version.to_string()).join(filename) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/files/models.rs:236:47 [INFO] [stdout] | [INFO] [stdout] 236 | Self::Original => write!(f, "{}", "orig"), [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 236 - Self::Original => write!(f, "{}", "orig"), [INFO] [stdout] 236 + Self::Original => write!(f, "orig"), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/files/models.rs:237:46 [INFO] [stdout] | [INFO] [stdout] 237 | Self::Preview => write!(f, "{}", "prev"), [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 237 - Self::Preview => write!(f, "{}", "prev"), [INFO] [stdout] 237 + Self::Preview => write!(f, "prev"), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/files/models.rs:238:48 [INFO] [stdout] | [INFO] [stdout] 238 | Self::Thumbnail => write!(f, "{}", "thumb"), [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 238 - Self::Thumbnail => write!(f, "{}", "thumb"), [INFO] [stdout] 238 + Self::Thumbnail => write!(f, "thumb"), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/files/queries.rs:55:5 [INFO] [stdout] | [INFO] [stdout] 55 | / if let Some(per_page_param) = params.per_page { [INFO] [stdout] 56 | | if per_page_param > 0 && per_page_param <= MAX_PER_PAGE { [INFO] [stdout] 57 | | per_page = per_page_param; [INFO] [stdout] 58 | | } [INFO] [stdout] 59 | | } [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] 55 ~ if let Some(per_page_param) = params.per_page [INFO] [stdout] 56 ~ && per_page_param > 0 && per_page_param <= MAX_PER_PAGE { [INFO] [stdout] 57 | per_page = per_page_param; [INFO] [stdout] 58 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/files/queries.rs:82:13 [INFO] [stdout] | [INFO] [stdout] 82 | / if let Some(keyword) = params_copy.keyword { [INFO] [stdout] 83 | | if keyword.len() > 0 { [INFO] [stdout] 84 | | let pattern = format!("%{}%", keyword); [INFO] [stdout] 85 | | query = query.filter(dsl::name.like(pattern)); [INFO] [stdout] 86 | | } [INFO] [stdout] 87 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 82 ~ if let Some(keyword) = params_copy.keyword [INFO] [stdout] 83 ~ && keyword.len() > 0 { [INFO] [stdout] 84 | let pattern = format!("%{}%", keyword); [INFO] [stdout] 85 | query = query.filter(dsl::name.like(pattern)); [INFO] [stdout] 86 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/files/queries.rs:83:20 [INFO] [stdout] | [INFO] [stdout] 83 | if keyword.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!keyword.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/files/queries.rs:124:13 [INFO] [stdout] | [INFO] [stdout] 124 | / if let Some(keyword) = params_copy.keyword { [INFO] [stdout] 125 | | if keyword.len() > 0 { [INFO] [stdout] 126 | | let pattern = format!("%{}%", keyword); [INFO] [stdout] 127 | | query = query.filter(dsl::name.like(pattern)); [INFO] [stdout] 128 | | } [INFO] [stdout] 129 | | } [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] 124 ~ if let Some(keyword) = params_copy.keyword [INFO] [stdout] 125 ~ && keyword.len() > 0 { [INFO] [stdout] 126 | let pattern = format!("%{}%", keyword); [INFO] [stdout] 127 | query = query.filter(dsl::name.like(pattern)); [INFO] [stdout] 128 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/files/queries.rs:125:20 [INFO] [stdout] | [INFO] [stdout] 125 | if keyword.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!keyword.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/files/queries.rs:229:5 [INFO] [stdout] | [INFO] [stdout] 229 | / let _ = match count_dir_files(db_pool, &dir.id).await { [INFO] [stdout] 230 | | Ok(count) => { [INFO] [stdout] 231 | | if count >= MAX_FILES as i64 { [INFO] [stdout] 232 | | if let Err(e) = cleanup_temp_uploads(data, None) { [INFO] [stdout] ... | [INFO] [stdout] 240 | | Err(e) => return Err(e), [INFO] [stdout] 241 | | }; [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 229 - let _ = match count_dir_files(db_pool, &dir.id).await { [INFO] [stdout] 229 + match count_dir_files(db_pool, &dir.id).await { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/files/queries.rs:244:12 [INFO] [stdout] | [INFO] [stdout] 244 | if let Some(_) = find_dir_file(db_pool, &dir.id, &data.name).await? { [INFO] [stdout] | -------^^^^^^^----------------------------------------------------- help: try: `if find_dir_file(db_pool, &dir.id, &data.name).await?.is_some()` [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: length comparison to zero [INFO] [stdout] --> src/files/queries.rs:269:20 [INFO] [stdout] | [INFO] [stdout] 269 | if versions.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!versions.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/files/queries.rs:420:20 [INFO] [stdout] | [INFO] [stdout] 420 | if errors.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!errors.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/files/queries.rs:484:70 [INFO] [stdout] | [INFO] [stdout] 484 | let msg = format!("Unable to decode image: {}", e.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/files/queries.rs:490:72 [INFO] [stdout] | [INFO] [stdout] 490 | let msg = format!("Unable to guess image format: {}", e.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/files/queries.rs:496:60 [INFO] [stdout] | [INFO] [stdout] 496 | let msg = format!("Unable to read image: {}", e.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this pattern reimplements `Option::unwrap_or` [INFO] [stdout] --> src/files/queries.rs:652:30 [INFO] [stdout] | [INFO] [stdout] 652 | Some(orientation) => match orientation.value.get_uint(0) { [INFO] [stdout] | ______________________________^ [INFO] [stdout] 653 | | Some(v @ 1..=8) => v, [INFO] [stdout] 654 | | _ => 1, [INFO] [stdout] 655 | | }, [INFO] [stdout] | |_________^ help: replace with: `orientation.value.get_uint(0).unwrap_or(1)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or [INFO] [stdout] = note: `#[warn(clippy::manual_unwrap_or)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `AuthToken` is never constructed [INFO] [stdout] --> src/auth/models.rs:79:12 [INFO] [stdout] | [INFO] [stdout] 79 | pub struct AuthToken { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ListBucketsParams` is never constructed [INFO] [stdout] --> src/buckets/models.rs:35:12 [INFO] [stdout] | [INFO] [stdout] 35 | pub struct ListBucketsParams { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/roles/models.rs:114:36 [INFO] [stdout] | [INFO] [stdout] 114 | pub fn to_permissions(permissions: &Vec) -> crate::Result> { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 114 - pub fn to_permissions(permissions: &Vec) -> crate::Result> { [INFO] [stdout] 114 + pub fn to_permissions(permissions: &[String]) -> crate::Result> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/roles/models.rs:165:33 [INFO] [stdout] | [INFO] [stdout] 165 | pub fn roles_permissions(roles: &Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 165 - pub fn roles_permissions(roles: &Vec) -> Vec { [INFO] [stdout] 165 + pub fn roles_permissions(roles: &[Role]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/auth/models.rs:62:48 [INFO] [stdout] | [INFO] [stdout] 62 | pub fn has_permissions(&self, permissions: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 62 - pub fn has_permissions(&self, permissions: &Vec) -> bool { [INFO] [stdout] 62 + pub fn has_permissions(&self, permissions: &[Permission]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/auth/password.rs:22:45 [INFO] [stdout] | [INFO] [stdout] 22 | let Ok(parsed_hash) = PasswordHash::new(&hash) else { [INFO] [stdout] | ^^^^^ help: change this to: `hash` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/auth/queries.rs:44:5 [INFO] [stdout] | [INFO] [stdout] 44 | let _ = verify_password(&credentials.password, &user.password)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] = note: `#[warn(clippy::let_unit_value)]` on by default [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 44 - let _ = verify_password(&credentials.password, &user.password)?; [INFO] [stdout] 44 + verify_password(&credentials.password, &user.password)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> src/auth/queries.rs:76:8 [INFO] [stdout] | [INFO] [stdout] 76 | if &user.client_id != &client.id { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 76 - if &user.client_id != &client.id { [INFO] [stdout] 76 + if user.client_id != client.id { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/auth/token.rs:52:8 [INFO] [stdout] | [INFO] [stdout] 52 | if decoded.claims.sub.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `decoded.claims.sub.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/auth/token.rs:55:8 [INFO] [stdout] | [INFO] [stdout] 55 | if decoded.claims.scope.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `decoded.claims.scope.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/buckets/commands.rs:68:12 [INFO] [stdout] | [INFO] [stdout] 68 | if let Some(_) = bucket { [INFO] [stdout] | -------^^^^^^^--------- help: try: `if bucket.is_some()` [INFO] [stdout] | [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: this let-binding has unit value [INFO] [stdout] --> src/buckets/commands.rs:69:9 [INFO] [stdout] | [INFO] [stdout] 69 | let _ = delete_bucket(&db_pool, &id).await?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 69 - let _ = delete_bucket(&db_pool, &id).await?; [INFO] [stdout] 69 + delete_bucket(&db_pool, &id).await?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/buckets/queries.rs:71:5 [INFO] [stdout] | [INFO] [stdout] 71 | / let _ = match count_client_buckets(db_pool, client_id).await { [INFO] [stdout] 72 | | Ok(count) => { [INFO] [stdout] 73 | | if count >= MAX_BUCKETS_PER_CLIENT as i64 { [INFO] [stdout] 74 | | return Err(Error::ValidationError( [INFO] [stdout] ... | [INFO] [stdout] 79 | | Err(e) => return Err(e), [INFO] [stdout] 80 | | }; [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 71 - let _ = match count_client_buckets(db_pool, client_id).await { [INFO] [stdout] 71 + match count_client_buckets(db_pool, client_id).await { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/buckets/queries.rs:83:12 [INFO] [stdout] | [INFO] [stdout] 83 | if let Some(_) = find_client_bucket(db_pool, client_id, &data.name).await? { [INFO] [stdout] | -------^^^^^^^------------------------------------------------------------ help: try: `if find_client_bucket(db_pool, client_id, &data.name).await?.is_some()` [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: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do [INFO] [stdout] --> src/storage/client.rs:68:17 [INFO] [stdout] | [INFO] [stdout] 68 | source_dir: &PathBuf, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 68 - source_dir: &PathBuf, [INFO] [stdout] 68 + source_dir: &Path, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/storage/client.rs:118:13 [INFO] [stdout] | [INFO] [stdout] 118 | let _ = upload_image_version(&client, bucket, dir, source_dir, &file, version).await?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 118 - let _ = upload_image_version(&client, bucket, dir, source_dir, &file, version).await?; [INFO] [stdout] 118 + upload_image_version(&client, bucket, dir, source_dir, &file, version).await?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/storage/client.rs:118:42 [INFO] [stdout] | [INFO] [stdout] 118 | let _ = upload_image_version(&client, bucket, dir, source_dir, &file, version).await?; [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/storage/client.rs:118:76 [INFO] [stdout] | [INFO] [stdout] 118 | let _ = upload_image_version(&client, bucket, dir, source_dir, &file, version).await?; [INFO] [stdout] | ^^^^^ help: change this to: `file` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do [INFO] [stdout] --> src/storage/client.rs:129:17 [INFO] [stdout] | [INFO] [stdout] 129 | source_dir: &PathBuf, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 129 - source_dir: &PathBuf, [INFO] [stdout] 129 + source_dir: &Path, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/storage/client.rs:185:36 [INFO] [stdout] | [INFO] [stdout] 185 | version.version.to_string(), [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/storage/client.rs:188:17 [INFO] [stdout] | [INFO] [stdout] 188 | let _ = delete_object_by_path(&client, bucket_name, &path).await?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 188 - let _ = delete_object_by_path(&client, bucket_name, &path).await?; [INFO] [stdout] 188 + delete_object_by_path(&client, bucket_name, &path).await?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/storage/client.rs:188:47 [INFO] [stdout] | [INFO] [stdout] 188 | let _ = delete_object_by_path(&client, bucket_name, &path).await?; [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/storage/client.rs:193:9 [INFO] [stdout] | [INFO] [stdout] 193 | let _ = delete_object_by_path(&client, bucket_name, &path).await?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 193 - let _ = delete_object_by_path(&client, bucket_name, &path).await?; [INFO] [stdout] 193 + delete_object_by_path(&client, bucket_name, &path).await?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/storage/client.rs:193:39 [INFO] [stdout] | [INFO] [stdout] 193 | let _ = delete_object_by_path(&client, bucket_name, &path).await?; [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/storage/client.rs:259:24 [INFO] [stdout] | [INFO] [stdout] 259 | format_file_single(&client, bucket_name, dir_name, file).await [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/storage/client.rs:278:40 [INFO] [stdout] | [INFO] [stdout] 278 | version.version.to_string(), [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/clients/commands.rs:90:12 [INFO] [stdout] | [INFO] [stdout] 90 | if let Some(_) = client { [INFO] [stdout] | -------^^^^^^^--------- help: try: `if client.is_some()` [INFO] [stdout] | [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: length comparison to zero [INFO] [stdout] --> src/storage/client.rs:287:16 [INFO] [stdout] | [INFO] [stdout] 287 | if updated_versions.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!updated_versions.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/clients/commands.rs:91:9 [INFO] [stdout] | [INFO] [stdout] 91 | let _ = delete_client(&db_pool, &id).await?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 91 - let _ = delete_client(&db_pool, &id).await?; [INFO] [stdout] 91 + delete_client(&db_pool, &id).await?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/clients/commands.rs:102:12 [INFO] [stdout] | [INFO] [stdout] 102 | if let Some(_) = client { [INFO] [stdout] | -------^^^^^^^--------- help: try: `if client.is_some()` [INFO] [stdout] | [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: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/storage/client.rs:307:5 [INFO] [stdout] | [INFO] [stdout] 307 | options.expires = expires; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `google_cloud_storage::sign::SignedURLOptions { expires: expires, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/storage/client.rs:306:5 [INFO] [stdout] | [INFO] [stdout] 306 | let mut options = SignedURLOptions::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/users/commands.rs:121:12 [INFO] [stdout] | [INFO] [stdout] 121 | if let Some(_) = user { [INFO] [stdout] | -------^^^^^^^------- help: try: `if user.is_some()` [INFO] [stdout] | [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: this let-binding has unit value [INFO] [stdout] --> src/users/commands.rs:122:9 [INFO] [stdout] | [INFO] [stdout] 122 | let _ = delete_user(&db_pool, &id).await?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 122 - let _ = delete_user(&db_pool, &id).await?; [INFO] [stdout] 122 + delete_user(&db_pool, &id).await?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/clients/queries.rs:60:5 [INFO] [stdout] | [INFO] [stdout] 60 | / let _ = match count_clients(db_pool).await { [INFO] [stdout] 61 | | Ok(count) => { [INFO] [stdout] 62 | | if count >= MAX_CLIENTS as i64 { [INFO] [stdout] 63 | | return Err(Error::ValidationError( [INFO] [stdout] ... | [INFO] [stdout] 68 | | Err(e) => return Err(e), [INFO] [stdout] 69 | | }; [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 60 - let _ = match count_clients(db_pool).await { [INFO] [stdout] 60 + match count_clients(db_pool).await { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/clients/queries.rs:72:12 [INFO] [stdout] | [INFO] [stdout] 72 | if let Some(_) = find_client_by_name(db_pool, &data.name).await? { [INFO] [stdout] | -------^^^^^^^-------------------------------------------------- help: try: `if find_client_by_name(db_pool, &data.name).await?.is_some()` [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: this let-binding has unit value [INFO] [stdout] --> src/users/queries.rs:61:5 [INFO] [stdout] | [INFO] [stdout] 61 | / let _ = match count_client_users(db_pool, client_id).await { [INFO] [stdout] 62 | | Ok(count) => { [INFO] [stdout] 63 | | if count >= MAX_USERS_PER_CLIENT as i64 { [INFO] [stdout] 64 | | return Err(Error::ValidationError( [INFO] [stdout] ... | [INFO] [stdout] 69 | | Err(e) => return Err(e), [INFO] [stdout] 70 | | }; [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 61 - let _ = match count_client_users(db_pool, client_id).await { [INFO] [stdout] 61 + match count_client_users(db_pool, client_id).await { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/users/queries.rs:73:12 [INFO] [stdout] | [INFO] [stdout] 73 | if let Some(_) = find_user_by_username(db_pool, &data.username).await? { [INFO] [stdout] | -------^^^^^^^-------------------------------------------------------- help: try: `if find_user_by_username(db_pool, &data.username).await?.is_some()` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/users/queries.rs:254:32 [INFO] [stdout] | [INFO] [stdout] 254 | let hashed = hash_password(&password)?; [INFO] [stdout] | ^^^^^^^^^ help: change this to: `password` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/util/id.rs:12:18 [INFO] [stdout] | [INFO] [stdout] 12 | _ => return false, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 12 - _ => return false, [INFO] [stdout] 12 + _ => false, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/util/id.rs:29:9 [INFO] [stdout] | [INFO] [stdout] 29 | assert_eq!(valid_id(id.as_str()), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_assert_comparison)]` on by default [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 29 - assert_eq!(valid_id(id.as_str()), true); [INFO] [stdout] 29 + assert!(valid_id(id.as_str())); [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/util/slug.rs:41:18 [INFO] [stdout] | [INFO] [stdout] 41 | let prefix = id [INFO] [stdout] | __________________^ [INFO] [stdout] 42 | | .split('-') [INFO] [stdout] 43 | | .last() [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 43 - .last() [INFO] [stdout] 43 + .next_back() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/config.rs:49:12 [INFO] [stdout] | [INFO] [stdout] 49 | if config.jwt_secret.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `config.jwt_secret.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/config.rs:52:12 [INFO] [stdout] | [INFO] [stdout] 52 | if config.cloud.project_id.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `config.cloud.project_id.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/config.rs:55:12 [INFO] [stdout] | [INFO] [stdout] 55 | if config.cloud.credentials.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `config.cloud.credentials.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/config.rs:58:12 [INFO] [stdout] | [INFO] [stdout] 58 | if config.db.url.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `config.db.url.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/validators/alphanumeric.rs:5:8 [INFO] [stdout] | [INFO] [stdout] 5 | if value.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `value.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/validators/anyname.rs:18:12 [INFO] [stdout] | [INFO] [stdout] 18 | if (k == 0 && c == ' ') || (k == value.len() - 1 && c == ' ') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 18 - if (k == 0 && c == ' ') || (k == value.len() - 1 && c == ' ') { [INFO] [stdout] 18 + if !(c != ' ' || k != 0 && k != value.len() - 1) { [INFO] [stdout] | [INFO] [stdout] 18 - if (k == 0 && c == ' ') || (k == value.len() - 1 && c == ' ') { [INFO] [stdout] 18 + if (k == value.len() - 1 || k == 0) && c == ' ' { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/validators/anyname.rs:5:8 [INFO] [stdout] | [INFO] [stdout] 5 | if value.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `value.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/validators/csvname.rs:8:8 [INFO] [stdout] | [INFO] [stdout] 8 | if value.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `value.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/validators/csvname.rs:20:12 [INFO] [stdout] | [INFO] [stdout] 20 | if chunk.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `chunk.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/validators/error.rs:21:53 [INFO] [stdout] | [INFO] [stdout] 21 | let msgs: Vec = item.iter().map(|i| error_to_string(i)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `error_to_string` [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 boolean expression can be simplified [INFO] [stdout] --> src/validators/sluggable.rs:18:12 [INFO] [stdout] | [INFO] [stdout] 18 | if (k == 0 && c == '-') || (k == value.len() - 1 && c == '-') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 18 - if (k == 0 && c == '-') || (k == value.len() - 1 && c == '-') { [INFO] [stdout] 18 + if !(c != '-' || k != 0 && k != value.len() - 1) { [INFO] [stdout] | [INFO] [stdout] 18 - if (k == 0 && c == '-') || (k == value.len() - 1 && c == '-') { [INFO] [stdout] 18 + if (k == value.len() - 1 || k == 0) && c == '-' { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/validators/sluggable.rs:5:8 [INFO] [stdout] | [INFO] [stdout] 5 | if value.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `value.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/web/dirs/handlers.rs:109:5 [INFO] [stdout] | [INFO] [stdout] 109 | let _ = delete_dir(&state.db_pool, &dir_id).await?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 109 - let _ = delete_dir(&state.db_pool, &dir_id).await?; [INFO] [stdout] 109 + delete_dir(&state.db_pool, &dir_id).await?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_err()` [INFO] [stdout] --> src/web/files/handlers.rs:88:16 [INFO] [stdout] | [INFO] [stdout] 88 | if let Err(_) = dir_res { [INFO] [stdout] | -------^^^^^^---------- help: try: `if dir_res.is_err()` [INFO] [stdout] | [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: this let-binding has unit value [INFO] [stdout] --> src/web/files/handlers.rs:163:5 [INFO] [stdout] | [INFO] [stdout] 163 | let _ = delete_file(&db_pool, &file.id).await?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 163 - let _ = delete_file(&db_pool, &file.id).await?; [INFO] [stdout] 163 + delete_file(&db_pool, &file.id).await?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/web/files/handlers.rs:168:5 [INFO] [stdout] | [INFO] [stdout] 168 | let _ = delete_file_object(&storage_client, &bucket.name, &dir.name, &dto).await?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 168 - let _ = delete_file_object(&storage_client, &bucket.name, &dir.name, &dto).await?; [INFO] [stdout] 168 + delete_file_object(&storage_client, &bucket.name, &dir.name, &dto).await?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/web/middlewares/auth.rs:54:5 [INFO] [stdout] | [INFO] [stdout] 53 | let response = next.run(request).await; [INFO] [stdout] | --------------------------------------- unnecessary `let` binding [INFO] [stdout] 54 | response [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 53 ~ [INFO] [stdout] 54 ~ next.run(request).await [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/web/middlewares/bucket.rs:77:5 [INFO] [stdout] | [INFO] [stdout] 76 | let response = next.run(request).await; [INFO] [stdout] | --------------------------------------- unnecessary `let` binding [INFO] [stdout] 77 | response [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 76 ~ [INFO] [stdout] 77 ~ next.run(request).await [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> src/web/middlewares/bucket.rs:66:8 [INFO] [stdout] | [INFO] [stdout] 66 | if &bucket.client_id != &actor.client_id { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 66 - if &bucket.client_id != &actor.client_id { [INFO] [stdout] 66 + if bucket.client_id != actor.client_id { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/web/middlewares/dir.rs:70:5 [INFO] [stdout] | [INFO] [stdout] 69 | let response = next.run(request).await; [INFO] [stdout] | --------------------------------------- unnecessary `let` binding [INFO] [stdout] 70 | response [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 69 ~ [INFO] [stdout] 70 ~ next.run(request).await [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> src/web/middlewares/dir.rs:59:8 [INFO] [stdout] | [INFO] [stdout] 59 | if &dir.bucket_id != ¶ms.bucket_id { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 59 - if &dir.bucket_id != ¶ms.bucket_id { [INFO] [stdout] 59 + if dir.bucket_id != params.bucket_id { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/web/middlewares/file.rs:63:5 [INFO] [stdout] | [INFO] [stdout] 62 | let response = next.run(request).await; [INFO] [stdout] | --------------------------------------- unnecessary `let` binding [INFO] [stdout] 63 | response [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 62 ~ [INFO] [stdout] 63 ~ next.run(request).await [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> src/web/middlewares/file.rs:52:8 [INFO] [stdout] | [INFO] [stdout] 52 | if &file.dir_id != &did { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 52 - if &file.dir_id != &did { [INFO] [stdout] 52 + if file.dir_id != did { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/dirs/queries.rs:41:5 [INFO] [stdout] | [INFO] [stdout] 41 | / if let Some(per_page_param) = params.per_page { [INFO] [stdout] 42 | | if per_page_param > 0 && per_page_param <= MAX_PER_PAGE { [INFO] [stdout] 43 | | per_page = per_page_param; [INFO] [stdout] 44 | | } [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_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 41 ~ if let Some(per_page_param) = params.per_page [INFO] [stdout] 42 ~ && per_page_param > 0 && per_page_param <= MAX_PER_PAGE { [INFO] [stdout] 43 | per_page = per_page_param; [INFO] [stdout] 44 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/dirs/queries.rs:68:13 [INFO] [stdout] | [INFO] [stdout] 68 | / if let Some(keyword) = params_copy.keyword { [INFO] [stdout] 69 | | if keyword.len() > 0 { [INFO] [stdout] 70 | | let pattern = format!("%{}%", keyword); [INFO] [stdout] 71 | | query = [INFO] [stdout] ... | [INFO] [stdout] 74 | | } [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] 68 ~ if let Some(keyword) = params_copy.keyword [INFO] [stdout] 69 ~ && keyword.len() > 0 { [INFO] [stdout] 70 | let pattern = format!("%{}%", keyword); [INFO] [stdout] 71 | query = [INFO] [stdout] 72 | query.filter(dsl::name.like(pattern.clone()).or(dsl::label.like(pattern))); [INFO] [stdout] 73 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/dirs/queries.rs:69:20 [INFO] [stdout] | [INFO] [stdout] 69 | if keyword.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!keyword.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/web/response.rs:51:5 [INFO] [stdout] | [INFO] [stdout] 51 | return create_response(status, serde_json::to_string(&body).unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 51 - return create_response(status, serde_json::to_string(&body).unwrap()); [INFO] [stdout] 51 + create_response(status, serde_json::to_string(&body).unwrap()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/dirs/queries.rs:111:13 [INFO] [stdout] | [INFO] [stdout] 111 | / if let Some(keyword) = params_copy.keyword { [INFO] [stdout] 112 | | if keyword.len() > 0 { [INFO] [stdout] 113 | | let pattern = format!("%{}%", keyword); [INFO] [stdout] 114 | | query = [INFO] [stdout] ... | [INFO] [stdout] 117 | | } [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] 111 ~ if let Some(keyword) = params_copy.keyword [INFO] [stdout] 112 ~ && keyword.len() > 0 { [INFO] [stdout] 113 | let pattern = format!("%{}%", keyword); [INFO] [stdout] 114 | query = [INFO] [stdout] 115 | query.filter(dsl::name.like(pattern.clone()).or(dsl::label.like(pattern))); [INFO] [stdout] 116 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/dirs/queries.rs:112:20 [INFO] [stdout] | [INFO] [stdout] 112 | if keyword.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!keyword.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/dirs/queries.rs:147:5 [INFO] [stdout] | [INFO] [stdout] 147 | / let _ = match count_bucket_dirs(db_pool, bucket_id).await { [INFO] [stdout] 148 | | Ok(count) => { [INFO] [stdout] 149 | | if count >= MAX_DIRS as i64 { [INFO] [stdout] 150 | | return Err(Error::ValidationError( [INFO] [stdout] ... | [INFO] [stdout] 155 | | Err(e) => return Err(e), [INFO] [stdout] 156 | | }; [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 147 - let _ = match count_bucket_dirs(db_pool, bucket_id).await { [INFO] [stdout] 147 + match count_bucket_dirs(db_pool, bucket_id).await { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/dirs/queries.rs:159:12 [INFO] [stdout] | [INFO] [stdout] 159 | if let Some(_) = find_bucket_dir(db_pool, bucket_id, data.name.as_str()).await? { [INFO] [stdout] | -------^^^^^^^----------------------------------------------------------------- help: try: `if find_bucket_dir(db_pool, bucket_id, data.name.as_str()).await?.is_some()` [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: literal with an empty format string [INFO] [stdout] --> src/error.rs:50:57 [INFO] [stdout] | [INFO] [stdout] 50 | Self::FileTypeNotAllowed => write!(f, "{}", "File type not allowed"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [INFO] [stdout] = note: `#[warn(clippy::write_literal)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 50 - Self::FileTypeNotAllowed => write!(f, "{}", "File type not allowed"), [INFO] [stdout] 50 + Self::FileTypeNotAllowed => write!(f, "File type not allowed"), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/files/models.rs:132:20 [INFO] [stdout] | [INFO] [stdout] 132 | if versions.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!versions.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do [INFO] [stdout] --> src/files/models.rs:184:35 [INFO] [stdout] | [INFO] [stdout] 184 | pub fn to_path(&self, prefix: &PathBuf, filename: &str) -> PathBuf { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 184 ~ pub fn to_path(&self, prefix: &Path, filename: &str) -> PathBuf { [INFO] [stdout] 185 ~ prefix.to_path_buf().join(self.version.to_string()).join(filename) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/files/models.rs:236:47 [INFO] [stdout] | [INFO] [stdout] 236 | Self::Original => write!(f, "{}", "orig"), [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 236 - Self::Original => write!(f, "{}", "orig"), [INFO] [stdout] 236 + Self::Original => write!(f, "orig"), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/files/models.rs:237:46 [INFO] [stdout] | [INFO] [stdout] 237 | Self::Preview => write!(f, "{}", "prev"), [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 237 - Self::Preview => write!(f, "{}", "prev"), [INFO] [stdout] 237 + Self::Preview => write!(f, "prev"), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/files/models.rs:238:48 [INFO] [stdout] | [INFO] [stdout] 238 | Self::Thumbnail => write!(f, "{}", "thumb"), [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 238 - Self::Thumbnail => write!(f, "{}", "thumb"), [INFO] [stdout] 238 + Self::Thumbnail => write!(f, "thumb"), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/files/queries.rs:55:5 [INFO] [stdout] | [INFO] [stdout] 55 | / if let Some(per_page_param) = params.per_page { [INFO] [stdout] 56 | | if per_page_param > 0 && per_page_param <= MAX_PER_PAGE { [INFO] [stdout] 57 | | per_page = per_page_param; [INFO] [stdout] 58 | | } [INFO] [stdout] 59 | | } [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] 55 ~ if let Some(per_page_param) = params.per_page [INFO] [stdout] 56 ~ && per_page_param > 0 && per_page_param <= MAX_PER_PAGE { [INFO] [stdout] 57 | per_page = per_page_param; [INFO] [stdout] 58 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/files/queries.rs:82:13 [INFO] [stdout] | [INFO] [stdout] 82 | / if let Some(keyword) = params_copy.keyword { [INFO] [stdout] 83 | | if keyword.len() > 0 { [INFO] [stdout] 84 | | let pattern = format!("%{}%", keyword); [INFO] [stdout] 85 | | query = query.filter(dsl::name.like(pattern)); [INFO] [stdout] 86 | | } [INFO] [stdout] 87 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 82 ~ if let Some(keyword) = params_copy.keyword [INFO] [stdout] 83 ~ && keyword.len() > 0 { [INFO] [stdout] 84 | let pattern = format!("%{}%", keyword); [INFO] [stdout] 85 | query = query.filter(dsl::name.like(pattern)); [INFO] [stdout] 86 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/files/queries.rs:83:20 [INFO] [stdout] | [INFO] [stdout] 83 | if keyword.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!keyword.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/files/queries.rs:124:13 [INFO] [stdout] | [INFO] [stdout] 124 | / if let Some(keyword) = params_copy.keyword { [INFO] [stdout] 125 | | if keyword.len() > 0 { [INFO] [stdout] 126 | | let pattern = format!("%{}%", keyword); [INFO] [stdout] 127 | | query = query.filter(dsl::name.like(pattern)); [INFO] [stdout] 128 | | } [INFO] [stdout] 129 | | } [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] 124 ~ if let Some(keyword) = params_copy.keyword [INFO] [stdout] 125 ~ && keyword.len() > 0 { [INFO] [stdout] 126 | let pattern = format!("%{}%", keyword); [INFO] [stdout] 127 | query = query.filter(dsl::name.like(pattern)); [INFO] [stdout] 128 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/files/queries.rs:125:20 [INFO] [stdout] | [INFO] [stdout] 125 | if keyword.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!keyword.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/files/queries.rs:229:5 [INFO] [stdout] | [INFO] [stdout] 229 | / let _ = match count_dir_files(db_pool, &dir.id).await { [INFO] [stdout] 230 | | Ok(count) => { [INFO] [stdout] 231 | | if count >= MAX_FILES as i64 { [INFO] [stdout] 232 | | if let Err(e) = cleanup_temp_uploads(data, None) { [INFO] [stdout] ... | [INFO] [stdout] 240 | | Err(e) => return Err(e), [INFO] [stdout] 241 | | }; [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 229 - let _ = match count_dir_files(db_pool, &dir.id).await { [INFO] [stdout] 229 + match count_dir_files(db_pool, &dir.id).await { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/files/queries.rs:244:12 [INFO] [stdout] | [INFO] [stdout] 244 | if let Some(_) = find_dir_file(db_pool, &dir.id, &data.name).await? { [INFO] [stdout] | -------^^^^^^^----------------------------------------------------- help: try: `if find_dir_file(db_pool, &dir.id, &data.name).await?.is_some()` [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: length comparison to zero [INFO] [stdout] --> src/files/queries.rs:269:20 [INFO] [stdout] | [INFO] [stdout] 269 | if versions.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!versions.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/files/queries.rs:420:20 [INFO] [stdout] | [INFO] [stdout] 420 | if errors.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!errors.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/files/queries.rs:484:70 [INFO] [stdout] | [INFO] [stdout] 484 | let msg = format!("Unable to decode image: {}", e.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/files/queries.rs:490:72 [INFO] [stdout] | [INFO] [stdout] 490 | let msg = format!("Unable to guess image format: {}", e.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/files/queries.rs:496:60 [INFO] [stdout] | [INFO] [stdout] 496 | let msg = format!("Unable to read image: {}", e.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this pattern reimplements `Option::unwrap_or` [INFO] [stdout] --> src/files/queries.rs:652:30 [INFO] [stdout] | [INFO] [stdout] 652 | Some(orientation) => match orientation.value.get_uint(0) { [INFO] [stdout] | ______________________________^ [INFO] [stdout] 653 | | Some(v @ 1..=8) => v, [INFO] [stdout] 654 | | _ => 1, [INFO] [stdout] 655 | | }, [INFO] [stdout] | |_________^ help: replace with: `orientation.value.get_uint(0).unwrap_or(1)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or [INFO] [stdout] = note: `#[warn(clippy::manual_unwrap_or)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/roles/models.rs:114:36 [INFO] [stdout] | [INFO] [stdout] 114 | pub fn to_permissions(permissions: &Vec) -> crate::Result> { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 114 - pub fn to_permissions(permissions: &Vec) -> crate::Result> { [INFO] [stdout] 114 + pub fn to_permissions(permissions: &[String]) -> crate::Result> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/roles/models.rs:165:33 [INFO] [stdout] | [INFO] [stdout] 165 | pub fn roles_permissions(roles: &Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 165 - pub fn roles_permissions(roles: &Vec) -> Vec { [INFO] [stdout] 165 + pub fn roles_permissions(roles: &[Role]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do [INFO] [stdout] --> src/storage/client.rs:68:17 [INFO] [stdout] | [INFO] [stdout] 68 | source_dir: &PathBuf, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 68 - source_dir: &PathBuf, [INFO] [stdout] 68 + source_dir: &Path, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/storage/client.rs:118:13 [INFO] [stdout] | [INFO] [stdout] 118 | let _ = upload_image_version(&client, bucket, dir, source_dir, &file, version).await?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 118 - let _ = upload_image_version(&client, bucket, dir, source_dir, &file, version).await?; [INFO] [stdout] 118 + upload_image_version(&client, bucket, dir, source_dir, &file, version).await?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/storage/client.rs:118:42 [INFO] [stdout] | [INFO] [stdout] 118 | let _ = upload_image_version(&client, bucket, dir, source_dir, &file, version).await?; [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/storage/client.rs:118:76 [INFO] [stdout] | [INFO] [stdout] 118 | let _ = upload_image_version(&client, bucket, dir, source_dir, &file, version).await?; [INFO] [stdout] | ^^^^^ help: change this to: `file` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do [INFO] [stdout] --> src/storage/client.rs:129:17 [INFO] [stdout] | [INFO] [stdout] 129 | source_dir: &PathBuf, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 129 - source_dir: &PathBuf, [INFO] [stdout] 129 + source_dir: &Path, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/storage/client.rs:185:36 [INFO] [stdout] | [INFO] [stdout] 185 | version.version.to_string(), [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/storage/client.rs:188:17 [INFO] [stdout] | [INFO] [stdout] 188 | let _ = delete_object_by_path(&client, bucket_name, &path).await?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 188 - let _ = delete_object_by_path(&client, bucket_name, &path).await?; [INFO] [stdout] 188 + delete_object_by_path(&client, bucket_name, &path).await?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/storage/client.rs:188:47 [INFO] [stdout] | [INFO] [stdout] 188 | let _ = delete_object_by_path(&client, bucket_name, &path).await?; [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/storage/client.rs:193:9 [INFO] [stdout] | [INFO] [stdout] 193 | let _ = delete_object_by_path(&client, bucket_name, &path).await?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 193 - let _ = delete_object_by_path(&client, bucket_name, &path).await?; [INFO] [stdout] 193 + delete_object_by_path(&client, bucket_name, &path).await?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/storage/client.rs:193:39 [INFO] [stdout] | [INFO] [stdout] 193 | let _ = delete_object_by_path(&client, bucket_name, &path).await?; [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/storage/client.rs:259:24 [INFO] [stdout] | [INFO] [stdout] 259 | format_file_single(&client, bucket_name, dir_name, file).await [INFO] [stdout] | ^^^^^^^ help: change this to: `client` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/storage/client.rs:278:40 [INFO] [stdout] | [INFO] [stdout] 278 | version.version.to_string(), [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/storage/client.rs:287:16 [INFO] [stdout] | [INFO] [stdout] 287 | if updated_versions.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!updated_versions.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/storage/client.rs:307:5 [INFO] [stdout] | [INFO] [stdout] 307 | options.expires = expires; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `google_cloud_storage::sign::SignedURLOptions { expires: expires, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/storage/client.rs:306:5 [INFO] [stdout] | [INFO] [stdout] 306 | let mut options = SignedURLOptions::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/users/commands.rs:121:12 [INFO] [stdout] | [INFO] [stdout] 121 | if let Some(_) = user { [INFO] [stdout] | -------^^^^^^^------- help: try: `if user.is_some()` [INFO] [stdout] | [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: this let-binding has unit value [INFO] [stdout] --> src/users/commands.rs:122:9 [INFO] [stdout] | [INFO] [stdout] 122 | let _ = delete_user(&db_pool, &id).await?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 122 - let _ = delete_user(&db_pool, &id).await?; [INFO] [stdout] 122 + delete_user(&db_pool, &id).await?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/users/queries.rs:61:5 [INFO] [stdout] | [INFO] [stdout] 61 | / let _ = match count_client_users(db_pool, client_id).await { [INFO] [stdout] 62 | | Ok(count) => { [INFO] [stdout] 63 | | if count >= MAX_USERS_PER_CLIENT as i64 { [INFO] [stdout] 64 | | return Err(Error::ValidationError( [INFO] [stdout] ... | [INFO] [stdout] 69 | | Err(e) => return Err(e), [INFO] [stdout] 70 | | }; [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 61 - let _ = match count_client_users(db_pool, client_id).await { [INFO] [stdout] 61 + match count_client_users(db_pool, client_id).await { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/users/queries.rs:73:12 [INFO] [stdout] | [INFO] [stdout] 73 | if let Some(_) = find_user_by_username(db_pool, &data.username).await? { [INFO] [stdout] | -------^^^^^^^-------------------------------------------------------- help: try: `if find_user_by_username(db_pool, &data.username).await?.is_some()` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/users/queries.rs:254:32 [INFO] [stdout] | [INFO] [stdout] 254 | let hashed = hash_password(&password)?; [INFO] [stdout] | ^^^^^^^^^ help: change this to: `password` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/util/id.rs:12:18 [INFO] [stdout] | [INFO] [stdout] 12 | _ => return false, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 12 - _ => return false, [INFO] [stdout] 12 + _ => false, [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/util/slug.rs:41:18 [INFO] [stdout] | [INFO] [stdout] 41 | let prefix = id [INFO] [stdout] | __________________^ [INFO] [stdout] 42 | | .split('-') [INFO] [stdout] 43 | | .last() [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 43 - .last() [INFO] [stdout] 43 + .next_back() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/validators/alphanumeric.rs:5:8 [INFO] [stdout] | [INFO] [stdout] 5 | if value.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `value.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/validators/anyname.rs:18:12 [INFO] [stdout] | [INFO] [stdout] 18 | if (k == 0 && c == ' ') || (k == value.len() - 1 && c == ' ') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 18 - if (k == 0 && c == ' ') || (k == value.len() - 1 && c == ' ') { [INFO] [stdout] 18 + if !(c != ' ' || k != 0 && k != value.len() - 1) { [INFO] [stdout] | [INFO] [stdout] 18 - if (k == 0 && c == ' ') || (k == value.len() - 1 && c == ' ') { [INFO] [stdout] 18 + if (k == value.len() - 1 || k == 0) && c == ' ' { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/validators/anyname.rs:5:8 [INFO] [stdout] | [INFO] [stdout] 5 | if value.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `value.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/validators/csvname.rs:8:8 [INFO] [stdout] | [INFO] [stdout] 8 | if value.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `value.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/validators/csvname.rs:20:12 [INFO] [stdout] | [INFO] [stdout] 20 | if chunk.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `chunk.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/validators/error.rs:21:53 [INFO] [stdout] | [INFO] [stdout] 21 | let msgs: Vec = item.iter().map(|i| error_to_string(i)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `error_to_string` [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 boolean expression can be simplified [INFO] [stdout] --> src/validators/sluggable.rs:18:12 [INFO] [stdout] | [INFO] [stdout] 18 | if (k == 0 && c == '-') || (k == value.len() - 1 && c == '-') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 18 - if (k == 0 && c == '-') || (k == value.len() - 1 && c == '-') { [INFO] [stdout] 18 + if !(c != '-' || k != 0 && k != value.len() - 1) { [INFO] [stdout] | [INFO] [stdout] 18 - if (k == 0 && c == '-') || (k == value.len() - 1 && c == '-') { [INFO] [stdout] 18 + if (k == value.len() - 1 || k == 0) && c == '-' { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/validators/sluggable.rs:5:8 [INFO] [stdout] | [INFO] [stdout] 5 | if value.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `value.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/web/dirs/handlers.rs:109:5 [INFO] [stdout] | [INFO] [stdout] 109 | let _ = delete_dir(&state.db_pool, &dir_id).await?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 109 - let _ = delete_dir(&state.db_pool, &dir_id).await?; [INFO] [stdout] 109 + delete_dir(&state.db_pool, &dir_id).await?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_err()` [INFO] [stdout] --> src/web/files/handlers.rs:88:16 [INFO] [stdout] | [INFO] [stdout] 88 | if let Err(_) = dir_res { [INFO] [stdout] | -------^^^^^^---------- help: try: `if dir_res.is_err()` [INFO] [stdout] | [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: this let-binding has unit value [INFO] [stdout] --> src/web/files/handlers.rs:163:5 [INFO] [stdout] | [INFO] [stdout] 163 | let _ = delete_file(&db_pool, &file.id).await?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 163 - let _ = delete_file(&db_pool, &file.id).await?; [INFO] [stdout] 163 + delete_file(&db_pool, &file.id).await?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/web/files/handlers.rs:168:5 [INFO] [stdout] | [INFO] [stdout] 168 | let _ = delete_file_object(&storage_client, &bucket.name, &dir.name, &dto).await?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 168 - let _ = delete_file_object(&storage_client, &bucket.name, &dir.name, &dto).await?; [INFO] [stdout] 168 + delete_file_object(&storage_client, &bucket.name, &dir.name, &dto).await?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/web/middlewares/auth.rs:54:5 [INFO] [stdout] | [INFO] [stdout] 53 | let response = next.run(request).await; [INFO] [stdout] | --------------------------------------- unnecessary `let` binding [INFO] [stdout] 54 | response [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 53 ~ [INFO] [stdout] 54 ~ next.run(request).await [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/web/middlewares/bucket.rs:77:5 [INFO] [stdout] | [INFO] [stdout] 76 | let response = next.run(request).await; [INFO] [stdout] | --------------------------------------- unnecessary `let` binding [INFO] [stdout] 77 | response [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 76 ~ [INFO] [stdout] 77 ~ next.run(request).await [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> src/web/middlewares/bucket.rs:66:8 [INFO] [stdout] | [INFO] [stdout] 66 | if &bucket.client_id != &actor.client_id { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 66 - if &bucket.client_id != &actor.client_id { [INFO] [stdout] 66 + if bucket.client_id != actor.client_id { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/web/middlewares/dir.rs:70:5 [INFO] [stdout] | [INFO] [stdout] 69 | let response = next.run(request).await; [INFO] [stdout] | --------------------------------------- unnecessary `let` binding [INFO] [stdout] 70 | response [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 69 ~ [INFO] [stdout] 70 ~ next.run(request).await [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> src/web/middlewares/dir.rs:59:8 [INFO] [stdout] | [INFO] [stdout] 59 | if &dir.bucket_id != ¶ms.bucket_id { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 59 - if &dir.bucket_id != ¶ms.bucket_id { [INFO] [stdout] 59 + if dir.bucket_id != params.bucket_id { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/web/middlewares/file.rs:63:5 [INFO] [stdout] | [INFO] [stdout] 62 | let response = next.run(request).await; [INFO] [stdout] | --------------------------------------- unnecessary `let` binding [INFO] [stdout] 63 | response [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 62 ~ [INFO] [stdout] 63 ~ next.run(request).await [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> src/web/middlewares/file.rs:52:8 [INFO] [stdout] | [INFO] [stdout] 52 | if &file.dir_id != &did { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 52 - if &file.dir_id != &did { [INFO] [stdout] 52 + if file.dir_id != did { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/web/response.rs:51:5 [INFO] [stdout] | [INFO] [stdout] 51 | return create_response(status, serde_json::to_string(&body).unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 51 - return create_response(status, serde_json::to_string(&body).unwrap()); [INFO] [stdout] 51 + create_response(status, serde_json::to_string(&body).unwrap()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 15s [INFO] running `Command { std: "docker" "inspect" "ee6908b6f94df42ef91eed5ca2bfc06ecaf5200f238b7b13033d58b07c8eed9c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "ee6908b6f94df42ef91eed5ca2bfc06ecaf5200f238b7b13033d58b07c8eed9c", kill_on_drop: false }` [INFO] [stdout] ee6908b6f94df42ef91eed5ca2bfc06ecaf5200f238b7b13033d58b07c8eed9c