Skip to content

fix(meta): refresh metastore if there is zdb up/down #178

fix(meta): refresh metastore if there is zdb up/down

fix(meta): refresh metastore if there is zdb up/down #178

GitHub Actions / clippy failed Nov 18, 2024 in 0s

clippy

3 errors

Details

Results

Message level Amount
Internal compiler error 0
Error 3
Warning 0
Note 0
Help 0

Versions

  • rustc 1.82.0 (f6e511eec 2024-10-15)
  • cargo 1.82.0 (8f40fc59f 2024-08-21)
  • clippy 0.1.82 (f6e511e 2024-10-15)

Annotations

Check failure on line 103 in zstor/src/actors/backends.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

error: this expression creates a reference which is immediately dereferenced by the compiler
   --> zstor/src/actors/backends.rs:103:65
    |
103 |                     if let Some((Some(db), _)) = managed_db.get(&ci) {
    |                                                                 ^^^ help: change this to: `ci`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check failure on line 83 in zstor/src/actors/backends.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

error: this expression creates a reference which is immediately dereferenced by the compiler
  --> zstor/src/actors/backends.rs:83:69
   |
83 |             if let Some((_, old_state)) = self.managed_meta_dbs.get(&ci) {
   |                                                                     ^^^ help: change this to: `ci`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
   = note: `-D clippy::needless-borrow` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::needless_borrow)]`

Check failure on line 107 in zstor/src/actors/backends.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this `else { if .. }` block can be collapsed

error: this `else { if .. }` block can be collapsed
   --> zstor/src/actors/backends.rs:101:20
    |
101 |               } else {
    |  ____________________^
102 | |                 if new_state.is_writeable() {
103 | |                     if let Some((Some(db), _)) = managed_db.get(&ci) {
104 | |                         backends.push(db.clone());
105 | |                     }
106 | |                 }
107 | |             }
    | |_____________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if
    = note: `-D clippy::collapsible-else-if` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::collapsible_else_if)]`
help: collapse nested if block
    |
101 ~             } else if new_state.is_writeable() {
102 +                 if let Some((Some(db), _)) = managed_db.get(&ci) {
103 +                     backends.push(db.clone());
104 +                 }
105 +             }
    |