Skip to content

Commit d8a24d3

Browse files
Simplifications from clippy
1 parent 73431a7 commit d8a24d3

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

src/lib.rs

+3-9
Original file line numberDiff line numberDiff line change
@@ -2318,10 +2318,10 @@ pub trait Itertools: Iterator {
23182318
// estimate lower bound of capacity needed
23192319
let (lower, _) = self.size_hint();
23202320
let mut result = String::with_capacity(sep.len() * lower);
2321-
write!(&mut result, "{}", first_elt).unwrap();
2321+
write!(&mut result, "{first_elt}").unwrap();
23222322
self.for_each(|elt| {
23232323
result.push_str(sep);
2324-
write!(&mut result, "{}", elt).unwrap();
2324+
write!(&mut result, "{elt}").unwrap();
23252325
});
23262326
result
23272327
}
@@ -4520,13 +4520,7 @@ where
45204520
(Some(a), Some(b)) => a == b,
45214521
_ => false,
45224522
};
4523-
assert!(
4524-
equal,
4525-
"Failed assertion {a:?} == {b:?} for iteration {i}",
4526-
i = i,
4527-
a = a,
4528-
b = b
4529-
);
4523+
assert!(equal, "Failed assertion {a:?} == {b:?} for iteration {i}",);
45304524
i += 1;
45314525
}
45324526
}

src/process_results_impl.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ where
6262

6363
impl<'a, I, T, E> DoubleEndedIterator for ProcessResults<'a, I, E>
6464
where
65-
I: Iterator<Item = Result<T, E>>,
66-
I: DoubleEndedIterator,
65+
I: DoubleEndedIterator<Item = Result<T, E>>,
6766
{
6867
fn next_back(&mut self) -> Option<Self::Item> {
6968
let item = self.iter.next_back();

src/repeatn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ where
3434
fn next(&mut self) -> Option<Self::Item> {
3535
if self.n > 1 {
3636
self.n -= 1;
37-
self.elt.as_ref().cloned()
37+
self.elt.clone()
3838
} else {
3939
self.n = 0;
4040
self.elt.take()

0 commit comments

Comments
 (0)