From 442b35b12b6b83c9066f690b2e2ab2e5ffe9d569 Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Sun, 3 Dec 2023 11:59:44 -0500 Subject: [PATCH] `clippy`: needless_borrow 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) --- src/cmd/excel.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/excel.rs b/src/cmd/excel.rs index c7305fa84..2838e891e 100644 --- a/src/cmd/excel.rs +++ b/src/cmd/excel.rs @@ -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)), };