Skip to content

Commit ccdc104

Browse files
committed
chore: bump MSRV to 1.87 for copy slice in constfn
1 parent 8170988 commit ccdc104

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ license = "MIT"
1313
readme = "README.md"
1414
documentation = "https://docs.rs/multihash/"
1515
edition = "2021"
16-
rust-version = "1.64"
16+
rust-version = "1.87"
1717

1818
[package.metadata.docs.rs]
1919
all-features = true

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Then run `cargo build`.
3535

3636
## MSRV
3737

38-
The minimum supported Rust version for this library is `1.64.0`.
38+
The minimum supported Rust version for this library is `1.87.0`.
3939
This is only guaranteed without additional features activated.
4040

4141
## Usage

src/multihash.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,9 @@ impl<const S: usize> Multihash<S> {
6262
}
6363
let size = input_digest.len();
6464
let mut digest = [0; S];
65-
let mut i = 0;
66-
while i < size {
67-
digest[i] = input_digest[i];
68-
i += 1;
69-
}
65+
// NOTE: cant use range systax in const fn yet
66+
digest.split_at_mut(size).0.copy_from_slice(input_digest);
67+
7068
Ok(Self {
7169
code,
7270
size: size as u8,

0 commit comments

Comments
 (0)