Skip to content

Commit ebeb2f6

Browse files
committed
fix: add clippy warns
1 parent ebaa196 commit ebeb2f6

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

src/cgr.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,10 @@ mod tests {
206206
};
207207

208208
let ot = Path::new(odir);
209-
std::fs::create_dir(&ot).unwrap();
209+
std::fs::create_dir(ot).unwrap();
210210

211-
chaos.draw(&ot).unwrap();
211+
chaos.draw(ot).unwrap();
212212

213-
fs::remove_dir_all(&ot).unwrap();
213+
fs::remove_dir_all(ot).unwrap();
214214
}
215215
}

src/icgr.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ impl<'de> Deserialize<'de> for TriIntegersList {
7979

8080
if parts.len() != 3 {
8181
return Err(de::Error::custom(format!(
82-
"Invalid triplet: '{}'. Expected format 'x,y,n'",
83-
entry
82+
"Invalid triplet: '{entry}'. Expected format 'x,y,n'"
8483
)));
8584
}
8685

@@ -124,7 +123,7 @@ impl TriIntegersList {
124123
- (overlap as usize * (self.len().saturating_sub(1)));
125124
if merged.len() != expected_len {
126125
return Err(IcgrError::OverlapMismatch {
127-
expected: format!("{}", expected_len),
126+
expected: format!("{expected_len}"),
128127
actual: format!("{}", merged.len()),
129128
});
130129
}
@@ -187,7 +186,7 @@ impl fmt::Display for TriIntegersList {
187186
.map(|x| format!("{},{},{}", x.x, x.y, x.n))
188187
.collect::<Vec<_>>()
189188
.join(";");
190-
write!(f, "{}", s)
189+
write!(f, "{s}")
191190
}
192191
}
193192

@@ -457,7 +456,7 @@ mod tests {
457456
y: "-5".to_string(),
458457
n: 3,
459458
}]);
460-
assert_eq!(format!("{}", ti), "10,-5,3");
459+
assert_eq!(format!("{ti}"), "10,-5,3");
461460
}
462461

463462
#[test]

src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ fn main() -> anyhow::Result<()> {
9494
};
9595

9696
let records = bicgr::read_from(reader)
97-
.map_err(|e| format!("Failed to read records: {}", e))
97+
.map_err(|e| format!("Failed to read records: {e}"))
9898
.unwrap();
9999

100100
for record in records {
@@ -106,7 +106,7 @@ fn main() -> anyhow::Result<()> {
106106
record.seq_id,
107107
record.desc.unwrap_or_default()
108108
)?;
109-
writeln!(destination, "{}", seq)?;
109+
writeln!(destination, "{seq}")?;
110110
}
111111
}
112112
Commands::Draw(args) => {
@@ -166,11 +166,11 @@ fn main() -> anyhow::Result<()> {
166166
if let Some(output) = args.output {
167167
let mut out = OpenOptions::new().append(true).create(true).open(output)?;
168168
for result in ssim {
169-
writeln!(out, "{}", result)?;
169+
writeln!(out, "{result}")?;
170170
}
171171
} else {
172172
for result in ssim {
173-
println!("{}", result);
173+
println!("{result}");
174174
}
175175
}
176176
}

0 commit comments

Comments
 (0)