From f1a6127282ce887aecd9cb817113a52167988d4e Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Wed, 14 Oct 2026 09:58:48 +0200 Subject: [PATCH 1/4] Use lockfile version 4 and require Rust 1.78+ Lockfile version 4 requires Cargo 1.78 or newer, so drop Rust 1.70 and 1.74 from CI and declare the new MSRV via `rust-version`. Closes #29 Co-Authored-By: Claude Opus 5.5 --- .github/workflows/test.yml | 10 +++++----- Cargo.lock | 2 +- Cargo.toml | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index aefdfaa..992490b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: build: strategy: matrix: - rust-version: ["1.70.0", "1.74.0", "1.78.0", "1.83.0", "1.87.0"] + rust-version: ["1.78.0", "1.83.0", "1.87.0"] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -25,7 +25,7 @@ jobs: build-no_std: strategy: matrix: - rust-version: ["1.70.0", "1.74.0", "1.78.0", "1.83.0", "1.87.0"] + rust-version: ["1.78.0", "1.83.0", "1.87.0"] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -38,7 +38,7 @@ jobs: test: strategy: matrix: - rust-version: ["1.70.0", "1.74.0", "1.78.0", "1.83.0", "1.87.0"] + rust-version: ["1.78.0", "1.83.0", "1.87.0"] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -50,7 +50,7 @@ jobs: test-no_std: strategy: matrix: - rust-version: ["1.70.0", "1.74.0", "1.78.0", "1.83.0", "1.87.0"] + rust-version: ["1.78.0", "1.83.0", "1.87.0"] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -62,7 +62,7 @@ jobs: clippy: strategy: matrix: - rust-version: ["1.70.0", "1.74.0", "1.78.0", "1.83.0", "1.87.0"] + rust-version: ["1.78.0", "1.83.0", "1.87.0"] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/Cargo.lock b/Cargo.lock index 0b16df7..ad21228 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "anybuf" diff --git a/Cargo.toml b/Cargo.toml index 2ed64d5..14da738 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,7 @@ name = "anybuf" version = "1.0.0" edition = "2021" +rust-version = "1.78" license = "Apache-2.0" description = "A minimal, zero dependency proto3 encoder to encode/decode anything. No schemas needed." keywords = ["protobuf3", "protobuf", "proto3", "proto", "encoding"] From a6ff86206aa31f1fee4488b800dea9a40cddeb5c Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Wed, 14 Oct 2026 10:00:46 +0200 Subject: [PATCH 2/4] Add latest Rust version Co-Authored-By: Claude Opus 5.5 --- .github/workflows/test.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 992490b..8f1c534 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: build: strategy: matrix: - rust-version: ["1.78.0", "1.83.0", "1.87.0"] + rust-version: ["1.78.0", "1.83.0", "1.87.0", "1.99.0"] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -25,7 +25,7 @@ jobs: build-no_std: strategy: matrix: - rust-version: ["1.78.0", "1.83.0", "1.87.0"] + rust-version: ["1.78.0", "1.83.0", "1.87.0", "1.99.0"] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -38,7 +38,7 @@ jobs: test: strategy: matrix: - rust-version: ["1.78.0", "1.83.0", "1.87.0"] + rust-version: ["1.78.0", "1.83.0", "1.87.0", "1.99.0"] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -50,7 +50,7 @@ jobs: test-no_std: strategy: matrix: - rust-version: ["1.78.0", "1.83.0", "1.87.0"] + rust-version: ["1.78.0", "1.83.0", "1.87.0", "1.99.0"] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -62,7 +62,7 @@ jobs: clippy: strategy: matrix: - rust-version: ["1.78.0", "1.83.0", "1.87.0"] + rust-version: ["1.78.0", "1.83.0", "1.87.0", "1.99.0"] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From d64c531d9938b3339b1ddc890468ca5241d101e9 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Wed, 14 Oct 2026 10:07:20 +0200 Subject: [PATCH 3/4] Fix mismatched_lifetime_syntaxes lint in Bufany::value Co-Authored-By: Claude Opus 5.5 --- src/bufany.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bufany.rs b/src/bufany.rs index 3c14411..dcb2676 100644 --- a/src/bufany.rs +++ b/src/bufany.rs @@ -846,7 +846,7 @@ impl<'a> Bufany<'a> { /// Gets the value of the given field number. This returns None if /// the field number does not exist - pub fn value(&self, field_number: u32) -> Option { + pub fn value(&self, field_number: u32) -> Option> { self.value_ref(field_number).cloned() } From a806fd3e9ec3246068d90cfe01125a5de23e4fe7 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Wed, 14 Oct 2026 10:18:30 +0200 Subject: [PATCH 4/4] Expand doc comment of enum Value<'a> --- src/bufany.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bufany.rs b/src/bufany.rs index dcb2676..9459027 100644 --- a/src/bufany.rs +++ b/src/bufany.rs @@ -866,6 +866,10 @@ impl<'a> Bufany<'a> { } /// A deserialized value +/// +/// The lifetime `'a` is the lifetime of the serialized input: variable length values +/// (i.e. bytes and strings) borrow their bytes from it instead of copying them (zero-copy). +/// When `Value<'a>` is cloned, the clone still borrows the original data. #[derive(Debug, PartialEq, Clone)] pub enum Value<'a> { /// Unknown varint (wire type = 0).