Skip to content

Commit 1f112a3

Browse files
committed
Test specializations in one function (1)
1 parent d9477ac commit 1f112a3

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

tests/specializations.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fn check_specialized_count_last_nth_sizeh<IterItem, Iter>(
3131
it: &Iter,
3232
known_expected_size: Option<usize>,
3333
) where
34-
IterItem: Eq + Debug,
34+
IterItem: Eq + Debug + Clone,
3535
Iter: Iterator<Item = IterItem> + Clone,
3636
{
3737
let size = it.clone().count();
@@ -54,13 +54,6 @@ fn check_specialized_count_last_nth_sizeh<IterItem, Iter>(
5454
}
5555
it_sh.next();
5656
}
57-
}
58-
59-
fn check_specialized_fold<IterItem, Iter>(it: &Iter)
60-
where
61-
IterItem: Eq + Debug + Clone,
62-
Iter: Iterator<Item = IterItem> + Clone,
63-
{
6457
check_specialized(it, |i| {
6558
let mut parameters_from_fold = vec![];
6659
let fold_result = i.fold(vec![], |mut acc, v: IterItem| {
@@ -77,13 +70,11 @@ fn put_back_test(test_vec: Vec<i32>, known_expected_size: Option<usize>) {
7770
// Lexical lifetimes support
7871
let pb = itertools::put_back(test_vec.iter());
7972
check_specialized_count_last_nth_sizeh(&pb, known_expected_size);
80-
check_specialized_fold(&pb);
8173
}
8274

8375
let mut pb = itertools::put_back(test_vec.into_iter());
8476
pb.put_back(1);
8577
check_specialized_count_last_nth_sizeh(&pb, known_expected_size.map(|x| x + 1));
86-
check_specialized_fold(&pb)
8778
}
8879

8980
#[test]
@@ -102,12 +93,10 @@ fn merge_join_by_test(i1: Vec<usize>, i2: Vec<usize>, known_expected_size: Optio
10293
let i2 = i2.into_iter();
10394
let mjb = i1.clone().merge_join_by(i2.clone(), std::cmp::Ord::cmp);
10495
check_specialized_count_last_nth_sizeh(&mjb, known_expected_size);
105-
check_specialized_fold(&mjb);
10696

10797
// And the other way around
10898
let mjb = i2.merge_join_by(i1, std::cmp::Ord::cmp);
10999
check_specialized_count_last_nth_sizeh(&mjb, known_expected_size);
110-
check_specialized_fold(&mjb);
111100
}
112101

113102
#[test]

0 commit comments

Comments
 (0)