From be5986f2a5680a52f32a988c59b16df3ab784bbb Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Sun, 12 Nov 2023 10:01:50 -0500 Subject: [PATCH] clippy:needless_borrow warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/cmd/joinp.rs:511:78 | 511 | util::decompress_snappy_file(&input1_path.to_path_buf(), &tmpdir)?; | ^^^^^^^ help: change this to: `tmpdir` | = 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/joinp.rs:536:78 | 536 | util::decompress_snappy_file(&input2_path.to_path_buf(), &tmpdir)?; | ^^^^^^^ help: change this to: `tmpdir` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow --- src/cmd/joinp.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/joinp.rs b/src/cmd/joinp.rs index 634366039..3b2124d27 100644 --- a/src/cmd/joinp.rs +++ b/src/cmd/joinp.rs @@ -508,7 +508,7 @@ impl Args { // if so, we need to decompress it first if input1_path.extension().and_then(std::ffi::OsStr::to_str) == Some("sz") { let decompressed_path = - util::decompress_snappy_file(&input1_path.to_path_buf(), &tmpdir)?; + util::decompress_snappy_file(&input1_path.to_path_buf(), tmpdir)?; self.arg_input1 = decompressed_path; } @@ -533,7 +533,7 @@ impl Args { // check if the right input file is snappy compressed if input2_path.extension().and_then(std::ffi::OsStr::to_str) == Some("sz") { let decompressed_path = - util::decompress_snappy_file(&input2_path.to_path_buf(), &tmpdir)?; + util::decompress_snappy_file(&input2_path.to_path_buf(), tmpdir)?; self.arg_input2 = decompressed_path; }