Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ jobs:
run: cargo test --verbose --all-features

msrv:
name: Verify MSRV (1.85)
name: Verify MSRV (1.99)
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

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

- name: Check
run: cargo check --all-features
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ All notable changes to this project are documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.0] - 2026-10-08

### Changed
- Raised `rust-version` from 1.85 to 1.99 in `Cargo.toml`. The CI MSRV
job now installs Rust 1.99.0. The README MSRV line reads 1.99. A minor
release carries this change. A raised MSRV is possibly breaking under
the Cargo book rules.
- Made `EncodedBytes::len` and `EncodedBytes::is_empty` const. This
change is additive. Fixed the clippy 0.1.99 `assert_is_empty` findings
in the unit tests and the basic example. No public item was removed or
renamed.

## [1.0.5] - 2026-07-29

### Changed
Expand Down Expand Up @@ -113,6 +125,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Performance characteristics documentation.
- Thread safety documentation.

[1.1.0]: https://github.com/cryptidtech/multi-trait/compare/v1.0.5...v1.1.0
[1.0.5]: https://github.com/cryptidtech/multi-trait/compare/v1.0.4...v1.0.5
[1.0.4]: https://github.com/cryptidtech/multi-trait/compare/v1.0.3...v1.0.4
[1.0.3]: https://github.com/cryptidtech/multi-trait/compare/v1.0.1...v1.0.3
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "multi-trait"
version = "1.0.5"
version = "1.1.0"
edition = "2024"
rust-version = "1.85"
rust-version = "1.99"
authors = ["Dave Grantham <dwg@linuxprogrammer.org>"]
description = "Common traits for multiformats types"
repository = "https://github.com/cryptidtech/multi-trait.git"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ For `no_std` environments:
multi-trait = { version = "1.1", default-features = false }
```

MSRV: Rust 1.85 (Edition 2024).
MSRV: Rust 1.99 (Edition 2024).

## Quick Start

Expand Down
4 changes: 2 additions & 2 deletions examples/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fn basic_encode_decode() {
println!("Decoded value: {decoded}");
println!("Remaining bytes: {remaining:?}");
assert_eq!(value, decoded);
assert!(remaining.is_empty());
assert_eq!(remaining.len(), 0);

println!();
}
Expand Down Expand Up @@ -82,7 +82,7 @@ fn sequential_operations() {
assert_eq!(val1, 42);
assert_eq!(val2, 1000);
assert_eq!(val3, 100000);
assert!(rest.is_empty());
assert_eq!(rest.len(), 0);

println!();
}
Expand Down
4 changes: 2 additions & 2 deletions src/encoded_bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ impl EncodedBytes {
/// ```
#[inline]
#[must_use]
pub fn len(&self) -> usize {
pub const fn len(&self) -> usize {
self.0.len()
}

Expand All @@ -126,7 +126,7 @@ impl EncodedBytes {
/// ```
#[inline]
#[must_use]
pub fn is_empty(&self) -> bool {
pub const fn is_empty(&self) -> bool {
self.0.is_empty()
}

Expand Down
26 changes: 13 additions & 13 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ mod test {
// Verify decode
let (val, rest) = u8::try_decode_from(&[0]).unwrap();
assert_eq!(val, 0);
assert!(rest.is_empty());
assert_eq!(rest.len(), 0);
}

#[test]
Expand All @@ -513,7 +513,7 @@ mod test {
let encoded = max.encode_into();
let (decoded, remaining) = u8::try_decode_from(&encoded).unwrap();
assert_eq!(decoded, max);
assert!(remaining.is_empty());
assert_eq!(remaining.len(), 0);
}

#[test]
Expand All @@ -522,7 +522,7 @@ mod test {
let encoded = max.encode_into();
let (decoded, remaining) = u16::try_decode_from(&encoded).unwrap();
assert_eq!(decoded, max);
assert!(remaining.is_empty());
assert_eq!(remaining.len(), 0);
}

#[test]
Expand All @@ -531,7 +531,7 @@ mod test {
let encoded = max.encode_into();
let (decoded, remaining) = u32::try_decode_from(&encoded).unwrap();
assert_eq!(decoded, max);
assert!(remaining.is_empty());
assert_eq!(remaining.len(), 0);
}

#[test]
Expand All @@ -540,7 +540,7 @@ mod test {
let encoded = max.encode_into();
let (decoded, remaining) = u64::try_decode_from(&encoded).unwrap();
assert_eq!(decoded, max);
assert!(remaining.is_empty());
assert_eq!(remaining.len(), 0);
}

#[test]
Expand All @@ -549,7 +549,7 @@ mod test {
let encoded = max.encode_into();
let (decoded, remaining) = u128::try_decode_from(&encoded).unwrap();
assert_eq!(decoded, max);
assert!(remaining.is_empty());
assert_eq!(remaining.len(), 0);
}

#[test]
Expand Down Expand Up @@ -591,7 +591,7 @@ mod test {
let encoded = value.encode_into();
let (decoded, remaining) = u8::try_decode_from(&encoded).unwrap();
assert_eq!(decoded, value, "Round-trip failed for u8 value {value}");
assert!(remaining.is_empty());
assert_eq!(remaining.len(), 0);
}
}

Expand All @@ -602,7 +602,7 @@ mod test {
let encoded = value.encode_into();
let (decoded, remaining) = u16::try_decode_from(&encoded).unwrap();
assert_eq!(decoded, value, "Round-trip failed for u16 value {value}");
assert!(remaining.is_empty());
assert_eq!(remaining.len(), 0);
}
}

Expand All @@ -613,7 +613,7 @@ mod test {
let encoded = value.encode_into();
let (decoded, remaining) = u32::try_decode_from(&encoded).unwrap();
assert_eq!(decoded, value, "Round-trip failed for u32 value {value}");
assert!(remaining.is_empty());
assert_eq!(remaining.len(), 0);
}
}

Expand All @@ -624,7 +624,7 @@ mod test {
let encoded = value.encode_into();
let (decoded, remaining) = u64::try_decode_from(&encoded).unwrap();
assert_eq!(decoded, value, "Round-trip failed for u64 value {value}");
assert!(remaining.is_empty());
assert_eq!(remaining.len(), 0);
}
}

Expand All @@ -634,7 +634,7 @@ mod test {
let encoded = value.encode_into();
let (decoded, remaining) = bool::try_decode_from(&encoded).unwrap();
assert_eq!(decoded, value, "Round-trip failed for bool {value}");
assert!(remaining.is_empty());
assert_eq!(remaining.len(), 0);
}
}

Expand Down Expand Up @@ -882,7 +882,7 @@ mod test {
assert_eq!(max_encoded.len(), 10);
let (decoded, remaining) = u64::try_decode_from(&max_encoded).unwrap();
assert_eq!(decoded, u64::MAX);
assert!(remaining.is_empty());
assert_eq!(remaining.len(), 0);
}

#[test]
Expand All @@ -892,7 +892,7 @@ mod test {
assert_eq!(max_encoded.len(), 19);
let (decoded, remaining) = u128::try_decode_from(&max_encoded).unwrap();
assert_eq!(decoded, u128::MAX);
assert!(remaining.is_empty());
assert_eq!(remaining.len(), 0);
}

#[test]
Expand Down
Loading