assert-json-diff icon indicating copy to clipboard operation
assert-json-diff copied to clipboard

fix clippy warnings

Open yanns opened this issue 3 years ago • 1 comments

Warnings:

cargo clippy
    Checking assert-json-diff v2.0.1 (/Users/yannsimon/projects/rust/assert-json-diff)
warning: this expression creates a reference which is immediately dereferenced by the compiler
  --> src/diff.rs:65:27
   |
65 |                 rhs: Some(&self.rhs),
   |                           ^^^^^^^^^ help: change this to: `self.rhs`
   |
   = note: `#[warn(clippy::needless_borrow)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

warning: this expression creates a reference which is immediately dereferenced by the compiler
  --> src/diff.rs:86:43
   |
86 | ...                   rhs: Some(&self.rhs),
   |                                 ^^^^^^^^^ help: change this to: `self.rhs`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> src/diff.rs:132:27
    |
132 |                 rhs: Some(&self.rhs),
    |                           ^^^^^^^^^ help: change this to: `self.rhs`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> src/diff.rs:153:43
    |
153 | ...                   rhs: Some(&self.rhs),
    |                                 ^^^^^^^^^ help: change this to: `self.rhs`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> src/diff.rs:195:27
    |
195 |                 rhs: Some(&self.rhs),
    |                           ^^^^^^^^^ help: change this to: `self.rhs`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

warning: `assert-json-diff` (lib) generated 5 warnings
    Finished dev [unoptimized + debuginfo] target(s) in 0.66s
```

yanns avatar Jun 30 '22 15:06 yanns

@davidpdrsn this is the PR fixing the warnings emitted by clippy.

yanns avatar Jul 07 '22 08:07 yanns

@davidpdrsn reminder to review this PR 😉

yanns avatar Aug 05 '22 09:08 yanns