From d16aa05df10afe87c9eb5f9fe7dc82182f1c89db Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 May 2025 13:26:02 +0000 Subject: [PATCH 1/5] 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](https://github.com/Xudong-Huang/generator-rs/compare/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] --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 1dc2d7b..9aa2784 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ bytes = { version = "1.2.1", optional = true } [dev-dependencies] serde = { version = "1.0", features = ["derive"] } assert_matches = "1.5.0" -generator = "0.7" +generator = "0.8" itertools = "0.14.0" [package.metadata.docs.rs] From 2b31c87f098c2ff8b4537d4e1b35acae39f76bf3 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sat, 7 Jun 2025 13:24:58 +1000 Subject: [PATCH 2/5] Fix lifetime of de::tests::generate_subslices --- src/de.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de.rs b/src/de.rs index 8f26cbf..2ff95c5 100644 --- a/src/de.rs +++ b/src/de.rs @@ -471,7 +471,7 @@ mod tests { /// Generate subslices, plus stuffing empty slices into the returned /// iterator. - fn generate_subslices(mut bytes: &[u8], chunk_size: usize) -> impl Iterator { + fn generate_subslices<'a>(mut bytes: &'a [u8], chunk_size: usize) -> impl Iterator { assert_ne!(chunk_size, 0); Gn::new_scoped(move |mut s| loop { From e65f38206df45ad06ecdd32ade78b0272fe7b24d Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sat, 7 Jun 2025 13:29:05 +1000 Subject: [PATCH 3/5] Fix lifetimr --- src/de.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/de.rs b/src/de.rs index 2ff95c5..3222caf 100644 --- a/src/de.rs +++ b/src/de.rs @@ -471,7 +471,10 @@ mod tests { /// Generate subslices, plus stuffing empty slices into the returned /// iterator. - fn generate_subslices<'a>(mut bytes: &'a [u8], chunk_size: usize) -> impl Iterator { + fn generate_subslices<'a>( + mut bytes: &'a [u8], + chunk_size: usize, + ) -> impl Iterator + 'a { assert_ne!(chunk_size, 0); Gn::new_scoped(move |mut s| loop { From a9c16435d3b12a382560036f473226cae4f2eaa3 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sat, 7 Jun 2025 19:11:40 +1000 Subject: [PATCH 4/5] Fix de.rs: use yield_with --- src/de.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de.rs b/src/de.rs index 3222caf..ca230e7 100644 --- a/src/de.rs +++ b/src/de.rs @@ -480,7 +480,7 @@ mod tests { Gn::new_scoped(move |mut s| loop { for _ in 0..8 { // Stuffing empty slices - s.yield_(&bytes[..0]); + s.yield_with(&bytes[..0]); } let n = bytes.len().min(chunk_size); From 367eaa3b74c6e3f793acd4eb0eabe2815977fb7f Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sat, 7 Jun 2025 19:15:46 +1000 Subject: [PATCH 5/5] Use yield_with --- src/de.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de.rs b/src/de.rs index ca230e7..8bbc42c 100644 --- a/src/de.rs +++ b/src/de.rs @@ -484,7 +484,7 @@ mod tests { } let n = bytes.len().min(chunk_size); - s.yield_(&bytes[..n]); + s.yield_with(&bytes[..n]); bytes = &bytes[n..]; if bytes.is_empty() {