Skip to content

Commit 4d6b25f

Browse files
committed
clippy and lint
1 parent 916fe67 commit 4d6b25f

File tree

6 files changed

+25
-13
lines changed

6 files changed

+25
-13
lines changed

src/distances.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ impl<'a> Distances<'a> for DistanceMatrix<'a> {
137137
}
138138
}
139139

140-
impl<'a> fmt::Display for DistanceMatrix<'a> {
140+
impl fmt::Display for DistanceMatrix<'_> {
141141
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
142142
let mut dist_idx = 0;
143143
if let Some(queries) = &self.query_names {
@@ -267,7 +267,7 @@ impl<'a> Distances<'a> for SparseDistanceMatrix<'a> {
267267
}
268268
}
269269

270-
impl<'a> fmt::Display for SparseDistanceMatrix<'a> {
270+
impl fmt::Display for SparseDistanceMatrix<'_> {
271271
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
272272
let mut ref_name_iter = self.ref_names.iter();
273273
let mut ref_name = ref_name_iter.next().unwrap();

src/multisketch.rs

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use serde::{Deserialize, Serialize};
1515
use crate::hashing::HashType;
1616
use crate::sketch::{Sketch, BBITS};
1717
use crate::sketch_datafile::SketchArrayFile;
18-
use crate::utils::get_progress_bar;
1918

2019
use std::collections::HashSet;
2120
#[derive(Serialize, Deserialize)]

src/structures.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
//! Support for .pdb files and the 3di alphabet
2+
#[cfg(feature = "3di")]
23
use crate::io::InputFastx;
4+
#[cfg(feature = "3di")]
35
use anyhow::Error;
46

7+
#[cfg(feature = "3di")]
58
use indicatif::{ProgressIterator, ProgressStyle};
69
#[cfg(feature = "3di")]
710
use pyo3::prelude::*;

tests/common/mod.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,7 @@ impl TestSetup {
115115
writeln!(
116116
rfile,
117117
"{}",
118-
&format!(
119-
"{}\t{}",
120-
file,
121-
self.file_string(file, TestDir::Input),
122-
)
118+
&format!("{}\t{}", file, self.file_string(file, TestDir::Input),)
123119
)
124120
.unwrap();
125121
}

tests/delete.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ mod tests {
1616
fn test_delete_sketches() {
1717
let sandbox = TestSetup::setup();
1818

19-
let rfile1 = sandbox.create_rfile(&vec!["14412_3#82.contigs_velvet.fa.gz", "14412_3#84.contigs_velvet.fa.gz", "R6.fa.gz", "TIGR4.fa.gz"]);
19+
let rfile1 = sandbox.create_rfile(&vec![
20+
"14412_3#82.contigs_velvet.fa.gz",
21+
"14412_3#84.contigs_velvet.fa.gz",
22+
"R6.fa.gz",
23+
"TIGR4.fa.gz",
24+
]);
2025
Command::new(cargo_bin("sketchlib"))
2126
.current_dir(sandbox.get_wd())
2227
.arg("sketch")
@@ -27,7 +32,10 @@ mod tests {
2732
.assert()
2833
.success();
2934

30-
let rfile2 = sandbox.create_rfile(&vec!["14412_3#82.contigs_velvet.fa.gz", "14412_3#84.contigs_velvet.fa.gz"]);
35+
let rfile2 = sandbox.create_rfile(&vec![
36+
"14412_3#82.contigs_velvet.fa.gz",
37+
"14412_3#84.contigs_velvet.fa.gz",
38+
]);
3139
Command::new(cargo_bin("sketchlib"))
3240
.current_dir(sandbox.get_wd())
3341
.arg("sketch")

tests/sketch.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ mod tests {
3636
.arg("info")
3737
.arg("assembly")
3838
.assert()
39-
.stdout_matches_path(sandbox.file_string("assembly_sketch_info.stdout", TestDir::Correct));
39+
.stdout_matches_path(
40+
sandbox.file_string("assembly_sketch_info.stdout", TestDir::Correct),
41+
);
4042

4143
Command::new(cargo_bin("sketchlib"))
4244
.current_dir(sandbox.get_wd())
@@ -45,7 +47,9 @@ mod tests {
4547
.arg("assembly")
4648
.arg("-v")
4749
.assert()
48-
.stdout_matches_path(sandbox.file_string("assembly_sketch_full_info.stdout", TestDir::Correct));
50+
.stdout_matches_path(
51+
sandbox.file_string("assembly_sketch_full_info.stdout", TestDir::Correct),
52+
);
4953
}
5054

5155
#[test]
@@ -82,6 +86,8 @@ mod tests {
8286
.arg("reads")
8387
.arg("-v")
8488
.assert()
85-
.stdout_matches_path(sandbox.file_string("read_sketch_full_info.stdout", TestDir::Correct));
89+
.stdout_matches_path(
90+
sandbox.file_string("read_sketch_full_info.stdout", TestDir::Correct),
91+
);
8692
}
8793
}

0 commit comments

Comments
 (0)