@@ -1001,23 +1001,23 @@ fn test_split_iterators_size_hint() {
1001
1001
Lower ,
1002
1002
Upper ,
1003
1003
}
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 ) {
1005
1005
match which {
1006
1006
Bounds :: Lower => {
1007
1007
let mut lower_bounds = vec ! [ it. size_hint( ) . 0 ] ;
1008
1008
while let Some ( _) = it. next ( ) {
1009
1009
lower_bounds. push ( it. size_hint ( ) . 0 ) ;
1010
1010
}
1011
1011
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 ) ;
1013
1013
}
1014
1014
Bounds :: Upper => {
1015
1015
let mut upper_bounds = vec ! [ it. size_hint( ) . 1 ] ;
1016
1016
while let Some ( _) = it. next ( ) {
1017
1017
upper_bounds. push ( it. size_hint ( ) . 1 ) ;
1018
1018
}
1019
1019
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 ) ;
1021
1021
}
1022
1022
}
1023
1023
}
@@ -1028,13 +1028,13 @@ fn test_split_iterators_size_hint() {
1028
1028
// p: predicate, b: bound selection
1029
1029
for ( p, b) in [
1030
1030
// 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
1032
1032
( ( |_| false ) as fn ( & _) -> _ , Bounds :: Lower ) ,
1033
1033
// 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
1035
1035
( ( |_| true ) as fn ( & _) -> _ , Bounds :: Upper ) ,
1036
1036
] {
1037
- use assert_precise_size_hints as a;
1037
+ use assert_tight_size_hints as a;
1038
1038
use format_args as f;
1039
1039
1040
1040
a ( v. split ( p) , b, "split" ) ;
0 commit comments