Skip to content

Cargo clippy local failures #568

Closed
Closed
@Westwooo

Description

@Westwooo

There are some failures that Cargo clippy is picking up that need fixing:

➜  couchbase-shell git:(main) ✗ cargo clippy
    Checking utilities v0.1.0 (/Users/jackwestwood/cbshell/couchbase-shell/utilities)
    Checking couchbase-shell v1.0.0 (/Users/jackwestwood/cbshell/couchbase-shell)
warning: assigning the result of `Clone::clone()` may be inefficient
   --> src/cli/vector_enrich_doc.rs:207:29
    |
207 | ...                   content_column = column.clone();
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `content_column.clone_from(column)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
    = note: `#[warn(clippy::assigning_clones)]` on by default

warning: assigning the result of `Clone::clone()` may be inefficient
  --> src/config.rs:83:29
   |
83 | ...                   config_credentials.username = cred.username.clone()
   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `config_credentials.username.clone_from(&cred.username)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones

warning: assigning the result of `Clone::clone()` may be inefficient
  --> src/config.rs:86:29
   |
86 | ...                   config_credentials.password = cred.password.clone()
   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `config_credentials.password.clone_from(&cred.password)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones

warning: assigning the result of `Clone::clone()` may be inefficient
  --> src/config.rs:99:29
   |
99 | ...                   config_credentials.secret_key = cred.secret_key.clone()
   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `config_credentials.secret_key.clone_from(&cred.secret_key)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones

warning: assigning the result of `Clone::clone()` may be inefficient
   --> src/config.rs:102:29
    |
102 | ...                   config_credentials.access_key = cred.access_key.clone()
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `config_credentials.access_key.clone_from(&cred.access_key)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones

warning: assigning the result of `Clone::clone()` may be inefficient
   --> src/state.rs:156:13
    |
156 |             *guard = active.clone();
    |             ^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `guard.clone_from(&active)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones

warning: `couchbase-shell` (bin "cbsh") generated 6 warnings (run `cargo clippy --fix --bin "cbsh"` to apply 6 suggestions)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 6.50s

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions