Skip to content

Commit e08f0dd

Browse files
kornelskiphimuemue
authored andcommitted
Use inline var format
for Clippy
1 parent b40b06b commit e08f0dd

File tree

5 files changed

+8
-9
lines changed

5 files changed

+8
-9
lines changed

benches/powerset.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const fn calc_iters(n: usize) -> usize {
88
}
99

1010
fn powerset_n(c: &mut Criterion, n: usize) {
11-
let id = format!("powerset {}", n);
11+
let id = format!("powerset {n}");
1212
c.bench_function(id.as_str(), move |b| {
1313
b.iter(|| {
1414
for _ in 0..calc_iters(n) {
@@ -21,7 +21,7 @@ fn powerset_n(c: &mut Criterion, n: usize) {
2121
}
2222

2323
fn powerset_n_fold(c: &mut Criterion, n: usize) {
24-
let id = format!("powerset {} fold", n);
24+
let id = format!("powerset {n} fold");
2525
c.bench_function(id.as_str(), move |b| {
2626
b.iter(|| {
2727
for _ in 0..calc_iters(n) {

examples/iris.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ fn main() {
6565
});
6666
let mut irises = match irises {
6767
Err(e) => {
68-
println!("Error parsing: {:?}", e);
68+
println!("Error parsing: {e:?}");
6969
std::process::exit(1);
7070
}
7171
Ok(data) => data,
@@ -101,7 +101,7 @@ fn main() {
101101

102102
// using Itertools::tuple_combinations
103103
for (a, b) in (0..4).tuple_combinations() {
104-
println!("Column {} vs {}:", a, b);
104+
println!("Column {a} vs {b}:");
105105

106106
// Clear plot
107107
//

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2476,10 +2476,10 @@ pub trait Itertools: Iterator {
24762476
// estimate lower bound of capacity needed
24772477
let (lower, _) = self.size_hint();
24782478
let mut result = String::with_capacity(sep.len() * lower);
2479-
write!(&mut result, "{}", first_elt).unwrap();
2479+
write!(&mut result, "{first_elt}").unwrap();
24802480
self.for_each(|elt| {
24812481
result.push_str(sep);
2482-
write!(&mut result, "{}", elt).unwrap();
2482+
write!(&mut result, "{elt}").unwrap();
24832483
});
24842484
result
24852485
}

tests/quick.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,7 @@ where
275275
let actual_count = total_actual_count - i;
276276
if actual_count != returned_count {
277277
println!(
278-
"Total iterations: {} True count: {} returned count: {}",
279-
i, actual_count, returned_count
278+
"Total iterations: {i} True count: {actual_count} returned count: {returned_count}"
280279
);
281280

282281
return false;

tests/test_std.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1531,7 +1531,7 @@ fn tree_reduce() {
15311531
Some(s.to_string())
15321532
};
15331533
let num_strings = (0..i).map(|x| x.to_string());
1534-
let actual = num_strings.tree_reduce(|a, b| format!("{} {} x", a, b));
1534+
let actual = num_strings.tree_reduce(|a, b| format!("{a} {b} x"));
15351535
assert_eq!(actual, expected);
15361536
}
15371537
}

0 commit comments

Comments
 (0)