Skip to content

Commit ceee485

Browse files
Update generator requirement from 0.7 to 0.8 (#18)
* Update generator requirement from 0.7 to 0.8 Updates the requirements on [generator](https://github.com/Xudong-Huang/generator-rs) to permit the latest version. - [Release notes](https://github.com/Xudong-Huang/generator-rs/releases) - [Commits](Xudong-Huang/generator-rs@0.7.0...0.8.5) --- updated-dependencies: - dependency-name: generator dependency-version: 0.8.5 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> * Fix lifetime of de::tests::generate_subslices * Fix lifetimr * Fix de.rs: use yield_with * Use yield_with --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jiahao XU <[email protected]>
1 parent fe3cc82 commit ceee485

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ bytes = { version = "1.2.1", optional = true }
2626
[dev-dependencies]
2727
serde = { version = "1.0", features = ["derive"] }
2828
assert_matches = "1.5.0"
29-
generator = "0.7"
29+
generator = "0.8"
3030
itertools = "0.14.0"
3131

3232
[package.metadata.docs.rs]

src/de.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -471,17 +471,20 @@ mod tests {
471471

472472
/// Generate subslices, plus stuffing empty slices into the returned
473473
/// 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 {
475478
assert_ne!(chunk_size, 0);
476479

477480
Gn::new_scoped(move |mut s| loop {
478481
for _ in 0..8 {
479482
// Stuffing empty slices
480-
s.yield_(&bytes[..0]);
483+
s.yield_with(&bytes[..0]);
481484
}
482485

483486
let n = bytes.len().min(chunk_size);
484-
s.yield_(&bytes[..n]);
487+
s.yield_with(&bytes[..n]);
485488
bytes = &bytes[n..];
486489

487490
if bytes.is_empty() {

0 commit comments

Comments
 (0)