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/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
  • Loading branch information
jqnatividad committed Nov 12, 2023
1 parent cc17799 commit be5986f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cmd/joinp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down

0 comments on commit be5986f

Please sign in to comment.