File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ bytes = { version = "1.2.1", optional = true }
26
26
[dev-dependencies ]
27
27
serde = { version = " 1.0" , features = [" derive" ] }
28
28
assert_matches = " 1.5.0"
29
- generator = " 0.7 "
29
+ generator = " 0.8 "
30
30
itertools = " 0.14.0"
31
31
32
32
[package .metadata .docs .rs ]
Original file line number Diff line number Diff line change @@ -471,17 +471,20 @@ mod tests {
471
471
472
472
/// Generate subslices, plus stuffing empty slices into the returned
473
473
/// iterator.
474
- fn generate_subslices ( mut bytes : & [ u8 ] , chunk_size : usize ) -> impl Iterator < Item = & [ u8 ] > {
474
+ fn generate_subslices < ' a > (
475
+ mut bytes : & ' a [ u8 ] ,
476
+ chunk_size : usize ,
477
+ ) -> impl Iterator < Item = & ' a [ u8 ] > + ' a {
475
478
assert_ne ! ( chunk_size, 0 ) ;
476
479
477
480
Gn :: new_scoped ( move |mut s| loop {
478
481
for _ in 0 ..8 {
479
482
// Stuffing empty slices
480
- s. yield_ ( & bytes[ ..0 ] ) ;
483
+ s. yield_with ( & bytes[ ..0 ] ) ;
481
484
}
482
485
483
486
let n = bytes. len ( ) . min ( chunk_size) ;
484
- s. yield_ ( & bytes[ ..n] ) ;
487
+ s. yield_with ( & bytes[ ..n] ) ;
485
488
bytes = & bytes[ n..] ;
486
489
487
490
if bytes. is_empty ( ) {
You can’t perform that action at this time.
0 commit comments