Skip to content

Commit

Permalink
Fix needless_borrow clippy lint in test
Browse files Browse the repository at this point in the history
    error: the borrowed expression implements the required traits
     --> tests/regression/issue1004.rs:6:38
      |
    6 |     let value = serde_json::to_value(&float).unwrap();
      |                                      ^^^^^^ help: change this to: `float`
      |
      = 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 clippy::all`
  • Loading branch information
dtolnay committed Mar 27, 2023
1 parent 4ea38c4 commit ce53b86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/regression/issue1004.rs
Expand Up @@ -3,7 +3,7 @@
#[test]
fn test() {
let float = 5.55f32;
let value = serde_json::to_value(&float).unwrap();
let value = serde_json::to_value(float).unwrap();
let json = serde_json::to_string(&value).unwrap();

// If the f32 were cast to f64 by Value before serialization, then this
Expand Down

0 comments on commit ce53b86

Please sign in to comment.