From ea631666044469ba777cfad3405797c17e0cf336 Mon Sep 17 00:00:00 2001 From: Cameron Duff Date: Tue, 22 Jul 2025 16:26:27 +1000 Subject: [PATCH 1/3] Make Digest 'update' method const --- src/crc128.rs | 2 +- src/crc16.rs | 2 +- src/crc32.rs | 2 +- src/crc64.rs | 2 +- src/crc8.rs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/crc128.rs b/src/crc128.rs index 54e4ed9..66b7424 100644 --- a/src/crc128.rs +++ b/src/crc128.rs @@ -51,7 +51,7 @@ where Digest { crc, value } } - pub fn update(&mut self, bytes: &[u8]) { + pub const fn update(&mut self, bytes: &[u8]) { self.value = self.crc.update(self.value, bytes); } diff --git a/src/crc16.rs b/src/crc16.rs index 7e058e1..2cc90ba 100644 --- a/src/crc16.rs +++ b/src/crc16.rs @@ -51,7 +51,7 @@ where Digest { crc, value } } - pub fn update(&mut self, bytes: &[u8]) { + pub const fn update(&mut self, bytes: &[u8]) { self.value = self.crc.update(self.value, bytes); } diff --git a/src/crc32.rs b/src/crc32.rs index a20a7b7..6375b10 100644 --- a/src/crc32.rs +++ b/src/crc32.rs @@ -51,7 +51,7 @@ where Digest { crc, value } } - pub fn update(&mut self, bytes: &[u8]) { + pub const fn update(&mut self, bytes: &[u8]) { self.value = self.crc.update(self.value, bytes); } diff --git a/src/crc64.rs b/src/crc64.rs index 3ddf305..4016c8f 100644 --- a/src/crc64.rs +++ b/src/crc64.rs @@ -51,7 +51,7 @@ where Digest { crc, value } } - pub fn update(&mut self, bytes: &[u8]) { + pub const fn update(&mut self, bytes: &[u8]) { self.value = self.crc.update(self.value, bytes); } diff --git a/src/crc8.rs b/src/crc8.rs index 547899c..f70172a 100644 --- a/src/crc8.rs +++ b/src/crc8.rs @@ -51,7 +51,7 @@ where Digest { crc, value } } - pub fn update(&mut self, bytes: &[u8]) { + pub const fn update(&mut self, bytes: &[u8]) { self.value = self.crc.update(self.value, bytes); } From b28183690f0b7f5b73f9a8eff68eefb48501cf5c Mon Sep 17 00:00:00 2001 From: Cameron Duff Date: Wed, 23 Jul 2025 12:15:11 +1000 Subject: [PATCH 2/3] Bump MSRV to 1.83 (2024-11-28) --- Cargo.toml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7964d90..9ecea4e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ description = "Rust implementation of CRC with support of various standards" keywords = ["crc", "crc16", "crc32", "crc64", "hash"] categories = ["algorithms", "no-std"] edition = "2021" -rust-version = "1.65" +rust-version = "1.83" [dependencies] crc-catalog = "2.4.0" diff --git a/README.md b/README.md index a36fad7..26f3337 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ assert_eq!(digest.finalize(), 0xaee7); ### Minimum supported Rust version (MSRV) -This crate's MSRV is 1.65. +This crate's MSRV is 1.83. At a minimum, the MSRV will be <= the oldest stable release in the last 12 months. MSRV may be bumped in minor version releases. From 6e68aa182ba0a64c3bc3bdad5895b289bd8969ae Mon Sep 17 00:00:00 2001 From: Cameron Duff Date: Wed, 23 Jul 2025 12:19:49 +1000 Subject: [PATCH 3/3] Update CI to MSRV 1.83 --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a6889f4..0f4127f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -24,7 +24,7 @@ jobs: strategy: matrix: rust: - - 1.65.0 + - 1.83.0 - stable - beta steps: