Skip to content

Commit

Permalink
Fix clippy lints introduced in 1.51 (#1407)
Browse files Browse the repository at this point in the history
  • Loading branch information
luizirber committed Mar 26, 2021
1 parent aeb648d commit 202bdc5
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 11 deletions.
12 changes: 6 additions & 6 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"homepage": "",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5852a21819542e6809f68ba5a798600e69874e76",
"sha256": "05vqlnafz287wamy2a3kp6h32mmha1ahq8gzp7slihdci2ibcdx6",
"rev": "c0e881852006b132236cbf0301bd1939bb50867e",
"sha256": "0fy7z7yxk5n7yslsvx5cyc6h21qwi4bhxf3awhirniszlbvaazy2",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/5852a21819542e6809f68ba5a798600e69874e76.tar.gz",
"url": "https://github.com/NixOS/nixpkgs/archive/c0e881852006b132236cbf0301bd1939bb50867e.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"rust-overlay": {
Expand All @@ -29,10 +29,10 @@
"homepage": null,
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "62d46e74e18babdb1d2b3994dbb91d5fa4672597",
"sha256": "0v7bfn0m0g4yywzxxa8ygll41mb8506kvkfbywdx0g7r6ddvcndr",
"rev": "d414b80c0e6e96977b52b1a0a547ea7613a5c6d5",
"sha256": "14bidf0paxb4hdbq60pxgxijjw7hi5rzdg9vj490rsikk58fb2qs",
"type": "tarball",
"url": "https://github.com/oxalica/rust-overlay/archive/62d46e74e18babdb1d2b3994dbb91d5fa4672597.tar.gz",
"url": "https://github.com/oxalica/rust-overlay/archive/d414b80c0e6e96977b52b1a0a547ea7613a5c6d5.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}
2 changes: 1 addition & 1 deletion src/core/src/ffi/hyperloglog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ unsafe fn hll_from_buffer(ptr: *const c_char, insize: usize) -> Result<*mut Sour
slice::from_raw_parts(ptr as *mut u8, insize)
};

let hll = HyperLogLog::from_reader(&mut &buf[..])?;
let hll = HyperLogLog::from_reader(buf)?;

Ok(SourmashHyperLogLog::from_rust(hll))
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/src/ffi/nodegraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ unsafe fn nodegraph_from_buffer(ptr: *const c_char, insize: usize) -> Result<*mu
slice::from_raw_parts(ptr as *mut u8, insize)
};

let ng = Nodegraph::from_reader(&mut &buf[..])?;
let ng = Nodegraph::from_reader(buf)?;

Ok(SourmashNodegraph::from_rust(ng))
}
Expand Down
3 changes: 3 additions & 0 deletions src/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
//! routines can use the NCBI taxonomy but do not depend on it in any way.
//! Documentation and further examples for each module can be found in the module descriptions below.

// TODO: remove this line and update all the appropriate type names for 1.0
#![allow(clippy::upper_case_acronyms)]

pub mod errors;
pub use errors::SourmashError as Error;

Expand Down
2 changes: 1 addition & 1 deletion src/core/src/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ impl Signature {

pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Vec<Signature>, Error> {
let mut reader = io::BufReader::new(File::open(path)?);
Ok(Signature::from_reader(&mut reader)?)
Signature::from_reader(&mut reader)
}

pub fn from_reader<R>(rdr: R) -> Result<Vec<Signature>, Error>
Expand Down
2 changes: 1 addition & 1 deletion src/core/src/sketch/hyperloglog/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ impl HyperLogLog {

pub fn from_path<P: AsRef<Path>>(path: P) -> Result<HyperLogLog, Error> {
let mut reader = io::BufReader::new(File::open(path)?);
Ok(HyperLogLog::from_reader(&mut reader)?)
HyperLogLog::from_reader(&mut reader)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/src/sketch/nodegraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ impl Nodegraph {

pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Nodegraph, Error> {
let mut reader = io::BufReader::new(File::open(path)?);
Ok(Nodegraph::from_reader(&mut reader)?)
Nodegraph::from_reader(&mut reader)
}

pub fn tablesizes(&self) -> Vec<u64> {
Expand Down

0 comments on commit 202bdc5

Please sign in to comment.