bluenote-1577 / sylph

ultrafast taxonomic profiling and genome querying for metagenomic samples by abundance-corrected minhash.
MIT License
185 stars 6 forks source link

redundant .clone() call on read_sketch_file #4

Closed stephenturner closed 10 months ago

stephenturner commented 11 months ago

Hello! Working on getting a Docker image built over in https://github.com/StaPH-B/docker-builds/pull/816 and noticed this during compilation:

#10 50.29    Compiling sylph v0.4.1 (/sylph-0.4.1)
#10 50.84 warning: call to `.clone()` on a reference in this situation does nothing
#10 50.84    --> src/contain.rs:485:47
#10 50.84     |
#10 50.84 485 |         let file = File::open(read_sketch_file.clone()).expect(&format!(
#10 50.84     |                                               ^^^^^^^^ help: remove this redundant call
#10 50.84     |
#10 50.84     = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed
#10 50.84     = note: `#[warn(noop_method_call)]` on by default

Is this something we need to be concerned with? cc @erinyoung

bluenote-1577 commented 11 months ago

Hi @stephenturner,

Thanks for bringing this up. This is not a big deal but I should fix it at some point... just a compiler warning.

I'll leave this up til I fix it