Skip to content

Commit 90a5afe

Browse files
Philippe-Choletphimuemue
authored andcommitted
Simplifications from clippy
`clippy::uninlined_format_args` and 2 more.
1 parent 93f4d39 commit 90a5afe

File tree

4 files changed

+6
-14
lines changed

4 files changed

+6
-14
lines changed

src/lib.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4776,13 +4776,7 @@ where
47764776
(Some(a), Some(b)) => a == b,
47774777
_ => false,
47784778
};
4779-
assert!(
4780-
equal,
4781-
"Failed assertion {a:?} == {b:?} for iteration {i}",
4782-
i = i,
4783-
a = a,
4784-
b = b
4785-
);
4779+
assert!(equal, "Failed assertion {a:?} == {b:?} for iteration {i}");
47864780
i += 1;
47874781
}
47884782
}

src/process_results_impl.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ where
6262

6363
impl<I, T, E> DoubleEndedIterator for ProcessResults<'_, 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

Lines changed: 1 addition & 1 deletion
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()

tests/quick.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ quickcheck! {
681681
assert_eq!(perm.len(), k);
682682

683683
let all_items_valid = perm.iter().all(|p| vals.contains(p));
684-
assert!(all_items_valid, "perm contains value not from input: {:?}", perm);
684+
assert!(all_items_valid, "perm contains value not from input: {perm:?}");
685685

686686
// Check that all perm items are distinct
687687
let distinct_len = {
@@ -691,7 +691,7 @@ quickcheck! {
691691
assert_eq!(perm.len(), distinct_len);
692692

693693
// Check that the perm is new
694-
assert!(actual.insert(perm.clone()), "perm already encountered: {:?}", perm);
694+
assert!(actual.insert(perm.clone()), "perm already encountered: {perm:?}");
695695
}
696696
}
697697

@@ -717,8 +717,7 @@ quickcheck! {
717717
for next_perm in perms {
718718
assert!(
719719
next_perm > curr_perm,
720-
"next perm isn't greater-than current; next_perm={:?} curr_perm={:?} n={}",
721-
next_perm, curr_perm, n
720+
"next perm isn't greater-than current; next_perm={next_perm:?} curr_perm={curr_perm:?} n={n}"
722721
);
723722

724723
curr_perm = next_perm;

0 commit comments

Comments
 (0)