Skip to content

Commit

Permalink
clippy: needless_borrow
Browse files Browse the repository at this point in the history
warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> src/cmd/excel.rs:630:76
    |
630 |                         DataType::DateTimeIso(ref dt) => record.push_field(&dt),
    |                                                                            ^^^ help: change this to: `dt`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `#[warn(clippy::needless_borrow)]` on by default

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> src/cmd/excel.rs:631:75
    |
631 |                         DataType::DurationIso(ref d) => record.push_field(&d),
    |                                                                           ^^ help: change this to: `d`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

warning: `qsv` (bin "qsv") generated 2 warnings (run `cargo clippy --fix --bin "qsv"` to apply 2 suggestions)
  • Loading branch information
jqnatividad committed Dec 3, 2023
1 parent 4d1327f commit 442b35b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cmd/excel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -627,8 +627,8 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
DataType::Bool(ref b) => {
record.push_field(if *b { "true" } else { "false" })
},
DataType::DateTimeIso(ref dt) => record.push_field(&dt),
DataType::DurationIso(ref d) => record.push_field(&d),
DataType::DateTimeIso(ref dt) => record.push_field(dt),
DataType::DurationIso(ref d) => record.push_field(d),
DataType::Duration(ref d) => record.push_field(ryu_buffer.format(*d)),
};

Expand Down

0 comments on commit 442b35b

Please sign in to comment.