From 0ad1167edd13bc7b941c2f31af1a219d855b2eaf Mon Sep 17 00:00:00 2001 From: gix-bot <107688624+gix-bot@users.noreply.github.com> Date: Fri, 6 Oct 2023 09:59:25 +0200 Subject: [PATCH] Update rust version (#1951) * Update rust version * Fix clippy complaints --------- Co-authored-by: gix-bot Co-authored-by: Frederik Rothenberger --- rust-toolchain.toml | 2 +- src/internet_identity/src/main.rs | 2 +- src/internet_identity/src/storage.rs | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 6a0e86d0c1..6b9ac7bc20 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.72.1" +channel = "1.73.0" targets = ["wasm32-unknown-unknown"] diff --git a/src/internet_identity/src/main.rs b/src/internet_identity/src/main.rs index 4e4d8029e3..5b44488742 100644 --- a/src/internet_identity/src/main.rs +++ b/src/internet_identity/src/main.rs @@ -286,7 +286,7 @@ fn stats() -> InternetIdentityStats { .map(|latest_delegation_origins| { latest_delegation_origins.keys().cloned().collect() }) - .unwrap_or(vec![]); + .unwrap_or_default(); ( origins, persistent_state.max_num_latest_delegation_origins.unwrap(), diff --git a/src/internet_identity/src/storage.rs b/src/internet_identity/src/storage.rs index e6c85e1304..83d1eea4cd 100644 --- a/src/internet_identity/src/storage.rs +++ b/src/internet_identity/src/storage.rs @@ -492,8 +492,7 @@ impl Storage { .map_err(PersistentStateError::ReadError)?; let size = u64::from_le_bytes(size_buf); - let mut data_buf = Vec::new(); - data_buf.resize(size as usize, 0); + let mut data_buf = vec![0; size as usize]; reader .read_exact(data_buf.as_mut_slice()) .map_err(PersistentStateError::ReadError)?;