Skip to content

Commit 095dc64

Browse files
authored
Merge pull request #10 from cryptidtech/fix/update-msrv
fix/update msrv
2 parents 50ec15e + 7f27d05 commit 095dc64

8 files changed

Lines changed: 31 additions & 26 deletions

File tree

‎.github/workflows/rust.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ jobs:
3434
run: cargo test --verbose --all-features
3535

3636
msrv:
37-
name: Verify MSRV (1.85)
37+
name: Verify MSRV (1.99)
3838
runs-on: ubuntu-latest
3939

4040
steps:
4141
- uses: actions/checkout@v4
4242

43-
- name: Install Rust Toolchain (1.85)
44-
uses: dtolnay/rust-toolchain@1.85.0
43+
- name: Install Rust Toolchain (1.99)
44+
uses: dtolnay/rust-toolchain@1.99.0
4545

4646
- name: Check
4747
run: cargo check --all-features

‎CHANGELOG.md‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ All notable changes to this project are documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased]
8+
## [1.6.0] - 2026-10-08
9+
10+
### Changed
11+
12+
- Raised `rust-version` from 1.85 to 1.99. The CI MSRV job pins 1.99.0 and the README MSRV line reads 1.99. A minor release carries this change: a raised MSRV is possibly breaking per the Cargo book rules.
13+
- Fixed the clippy 0.1.99 `assert_is_empty` findings in the edge-case, error, and integration test suites. `CodecName::len` and `CodecName::is_empty` are now `const fn`. The API changes are additive. No public item was removed or renamed.
914

1015
## [1.5.0] - 2026-09-14
1116

@@ -197,6 +202,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
197202
- Moved `CodecInfo` and `EncodingInfo` to the `multi-util` crate.
198203
- Cleaned up imports and exports.
199204

205+
[1.6.0]: https://github.com/cryptidtech/multi-codec/compare/v1.5.0...v1.6.0
200206
[1.1.0]: https://github.com/cryptidtech/multi-codec/compare/v1.0.5...v1.1.0
201207
[1.0.5]: https://github.com/cryptidtech/multi-codec/compare/v1.0.4...v1.0.5
202208
[1.0.4]: https://github.com/cryptidtech/multi-codec/compare/v1.0.3...v1.0.4

‎Cargo.toml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
22
name = "multi-codec"
3-
version = "1.5.0"
3+
version = "1.6.0"
44
edition = "2024"
5-
rust-version = "1.85"
5+
rust-version = "1.99"
66
authors = ["Benjamin Kampmann <ben@gnunicorn.org>", "Dave Grantham <dwg@linuxprogrammer.org>"]
77
description = "Implementation of the Multicodec specification"
88
repository = "https://github.com/cryptidtech/multi-codec.git"
@@ -17,15 +17,15 @@ std = ["thiserror/std", "serde/std", "multi-trait/std"]
1717
serde = ["dep:serde"]
1818

1919
[dependencies]
20-
multi-trait = { version = "1.0", default-features = false }
20+
multi-trait = { version = "1.1", default-features = false }
2121
thiserror = { version = "2.0", default-features = false }
2222
serde = { version = "1.0", default-features = false, optional = true, features = ["serde_derive"] }
2323

2424
[dev-dependencies]
2525
ciborium = "0.2"
2626
criterion = { version = "0.8", features = ["html_reports"] }
2727
hex = "0.4"
28-
proptest = "1.4"
28+
proptest = "1.11"
2929
serde_json = "1.0"
3030
serde_test = "1.0"
3131
unsigned-varint = { version = "0.8", features = ["std"] }
@@ -49,6 +49,6 @@ path = "examples/uvi.rs"
4949

5050
[build-dependencies]
5151
convert_case = "0.12"
52-
csv = "1.3"
52+
csv = "1.4"
5353
serde = { version = "1.0", features = ["serde_derive"] }
5454
serde_derive = "1.0"

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ To use serde under `no_std`, enable only the `serde` feature:
7272
multi-codec = { version = "1.1", default-features = false, features = ["serde"] }
7373
```
7474

75-
MSRV: Rust 1.85 (Edition 2024).
75+
MSRV: Rust 1.99 (Edition 2024).
7676

7777
## Usage
7878

‎src/types.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ impl CodecName {
240240
/// assert_eq!(name.len(), 8);
241241
/// ```
242242
#[must_use]
243-
pub fn len(&self) -> usize {
243+
pub const fn len(&self) -> usize {
244244
self.0.len()
245245
}
246246

@@ -258,7 +258,7 @@ impl CodecName {
258258
/// assert!(!name.is_empty());
259259
/// ```
260260
#[must_use]
261-
pub fn is_empty(&self) -> bool {
261+
pub const fn is_empty(&self) -> bool {
262262
self.0.is_empty()
263263
}
264264
}

‎tests/edge_case_tests.rs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ fn test_identity_encoding() {
150150
// Decode back
151151
let (decoded, remaining) = Codec::try_decode_from(&encoded).unwrap();
152152
assert_eq!(decoded, Codec::Identity);
153-
assert!(remaining.is_empty());
153+
assert_eq!(remaining.len(), 0);
154154
}
155155

156156
/// Test decoding with no remaining bytes
@@ -161,7 +161,6 @@ fn test_decode_exact_length() {
161161

162162
let (decoded, remaining) = Codec::try_decode_from(&encoded).unwrap();
163163
assert_eq!(decoded, codec);
164-
assert!(remaining.is_empty());
165164
assert_eq!(remaining.len(), 0);
166165
}
167166

‎tests/error_tests.rs‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,17 +142,17 @@ fn test_error_context_for_debugging() {
142142
let err = Error::invalid_name("test-codec");
143143
let context = err.context();
144144
assert!(context.contains("test-codec"));
145-
assert!(!context.is_empty());
145+
assert_ne!(context, "");
146146

147147
let err = Error::invalid_value(0x123);
148148
let context = err.context();
149149
assert!(context.contains("0x123") || context.contains("123") || context.contains("291"));
150-
assert!(!context.is_empty());
150+
assert_ne!(context, "");
151151

152152
let err = Error::negative_value(-100);
153153
let context = err.context();
154154
assert!(context.contains("-100"));
155-
assert!(!context.is_empty());
155+
assert_ne!(context, "");
156156
}
157157

158158
/// Test that error types can be matched on
@@ -210,17 +210,17 @@ fn test_error_trait_impl() {
210210
fn test_error_display_informative() {
211211
let err = Error::invalid_name("bad-name");
212212
let display = format!("{err}");
213-
assert!(!display.is_empty());
213+
assert_ne!(display, "");
214214
assert!(display.len() > 20); // Should be a full sentence, not just a few words
215215

216216
let err = Error::invalid_value(999);
217217
let display = format!("{err}");
218-
assert!(!display.is_empty());
218+
assert_ne!(display, "");
219219
assert!(display.len() > 20);
220220

221221
let err = Error::negative_value(-10);
222222
let display = format!("{err}");
223-
assert!(!display.is_empty());
223+
assert_ne!(display, "");
224224
assert!(display.len() > 20);
225225
}
226226

@@ -229,6 +229,6 @@ fn test_error_display_informative() {
229229
fn test_error_debug_output() {
230230
let err = Error::invalid_name("test");
231231
let debug = format!("{err:?}");
232-
assert!(!debug.is_empty());
232+
assert_ne!(debug, "");
233233
assert!(debug.contains("InvalidName") || debug.contains("test"));
234234
}

‎tests/integration_tests.rs‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ fn test_full_encode_decode_cycle() {
2828

2929
// Encode to bytes
3030
let bytes: Vec<u8> = original.into();
31-
assert!(!bytes.is_empty());
31+
assert_ne!(bytes, Vec::<u8>::new());
3232

3333
// Decode from bytes
3434
let (decoded, remaining) = Codec::try_decode_from(&bytes).unwrap();
3535
assert_eq!(decoded, original);
36-
assert!(remaining.is_empty());
36+
assert_eq!(remaining.len(), 0);
3737

3838
// Verify code matches
3939
assert_eq!(decoded.code(), original.code());
@@ -175,12 +175,12 @@ fn test_multitrait_integration() {
175175

176176
// Convert to Vec<u8> which uses EncodeInto internally
177177
let encoded: Vec<u8> = codec.into();
178-
assert!(!encoded.is_empty());
178+
assert_ne!(encoded, Vec::<u8>::new());
179179

180180
// Use TryDecodeFrom from multitrait
181181
let (decoded, remaining) = Codec::try_decode_from(&encoded).unwrap();
182182
assert_eq!(decoded, codec);
183-
assert!(remaining.is_empty());
183+
assert_eq!(remaining.len(), 0);
184184
}
185185

186186
/// Test error types in real-world scenarios
@@ -262,7 +262,7 @@ fn test_sequential_encoding() {
262262
remaining = rest;
263263
}
264264

265-
assert!(remaining.is_empty());
265+
assert_eq!(remaining.len(), 0);
266266
}
267267

268268
/// Test codec with pattern matching

0 commit comments

Comments
 (0)