Skip to content

Commit 3f0d04e

Browse files
committed
Improve wording, correct -> tight.
1 parent 4304686 commit 3f0d04e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

library/alloc/tests/slice.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,23 +1001,23 @@ fn test_split_iterators_size_hint() {
10011001
Lower,
10021002
Upper,
10031003
}
1004-
fn assert_precise_size_hints(mut it: impl Iterator, which: Bounds, context: impl fmt::Display) {
1004+
fn assert_tight_size_hints(mut it: impl Iterator, which: Bounds, ctx: impl fmt::Display) {
10051005
match which {
10061006
Bounds::Lower => {
10071007
let mut lower_bounds = vec![it.size_hint().0];
10081008
while let Some(_) = it.next() {
10091009
lower_bounds.push(it.size_hint().0);
10101010
}
10111011
let target: Vec<_> = (0..lower_bounds.len()).rev().collect();
1012-
assert_eq!(lower_bounds, target, "incorrect lower bounds: {}", context);
1012+
assert_eq!(lower_bounds, target, "lower bounds incorrect or not tight: {}", ctx);
10131013
}
10141014
Bounds::Upper => {
10151015
let mut upper_bounds = vec![it.size_hint().1];
10161016
while let Some(_) = it.next() {
10171017
upper_bounds.push(it.size_hint().1);
10181018
}
10191019
let target: Vec<_> = (0..upper_bounds.len()).map(Some).rev().collect();
1020-
assert_eq!(upper_bounds, target, "incorrect upper bounds: {}", context);
1020+
assert_eq!(upper_bounds, target, "upper bounds incorrect or not tight: {}", ctx);
10211021
}
10221022
}
10231023
}
@@ -1028,13 +1028,13 @@ fn test_split_iterators_size_hint() {
10281028
// p: predicate, b: bound selection
10291029
for (p, b) in [
10301030
// with a predicate always returning false, the split*-iterators
1031-
// become maximally short, so the size_hint lower bounds are correct
1031+
// become maximally short, so the size_hint lower bounds are tight
10321032
((|_| false) as fn(&_) -> _, Bounds::Lower),
10331033
// with a predicate always returning true, the split*-iterators
1034-
// become maximally long, so the size_hint upper bounds are correct
1034+
// become maximally long, so the size_hint upper bounds are tight
10351035
((|_| true) as fn(&_) -> _, Bounds::Upper),
10361036
] {
1037-
use assert_precise_size_hints as a;
1037+
use assert_tight_size_hints as a;
10381038
use format_args as f;
10391039

10401040
a(v.split(p), b, "split");

0 commit comments

Comments
 (0)