From 6e990f30e011301afaf108a02ade5e09326b4e44 Mon Sep 17 00:00:00 2001 From: Andreas Fackler Date: Mon, 17 Jun 2024 15:18:23 +0200 Subject: [PATCH] Upgrade to Rust 1.79.0 (#2132) --- linera-base/src/crypto.rs | 5 +---- linera-core/src/client.rs | 2 +- linera-indexer/plugins/src/operations.rs | 6 +++--- linera-service/tests/end_to_end_tests.rs | 2 +- linera-views/tests/queueview_tests.rs | 4 ++-- toolchains/build/rust-toolchain.toml | 2 +- 6 files changed, 9 insertions(+), 12 deletions(-) diff --git a/linera-base/src/crypto.rs b/linera-base/src/crypto.rs index ed4293bbdbe..7f40b8707d8 100644 --- a/linera-base/src/crypto.rs +++ b/linera-base/src/crypto.rs @@ -416,10 +416,7 @@ where impl CryptoHash { /// Computes a hash. - pub fn new(value: &T) -> Self - where - T: BcsHashable, - { + pub fn new(value: &T) -> Self { use sha3::digest::Digest; let mut hasher = sha3::Sha3_256::default(); diff --git a/linera-core/src/client.rs b/linera-core/src/client.rs index a446f74d696..3c365bfc5b5 100644 --- a/linera-core/src/client.rs +++ b/linera-core/src/client.rs @@ -293,7 +293,7 @@ pub enum ChainClientError { impl From for ChainClientError { fn from(infallible: Infallible) -> Self { - infallible.into() + match infallible {} } } diff --git a/linera-indexer/plugins/src/operations.rs b/linera-indexer/plugins/src/operations.rs index 6694e93c3b3..02bb0eec161 100644 --- a/linera-indexer/plugins/src/operations.rs +++ b/linera-indexer/plugins/src/operations.rs @@ -199,12 +199,12 @@ where let mut result = Vec::new(); let limit = limit.unwrap_or(20); for _ in 0..limit { - let Some(next_key) = key else { break }; - let operation = plugin.operations.get(&next_key).await?; + let Some(next_key) = &key else { break }; + let operation = plugin.operations.get(next_key).await?; match operation { None => break, Some(op) => { - key = op.previous_operation.clone(); + key.clone_from(&op.previous_operation); result.push(op) } } diff --git a/linera-service/tests/end_to_end_tests.rs b/linera-service/tests/end_to_end_tests.rs index 965b31d6876..e5fb34eb452 100644 --- a/linera-service/tests/end_to_end_tests.rs +++ b/linera-service/tests/end_to_end_tests.rs @@ -1265,7 +1265,7 @@ async fn test_wasm_end_to_end_crowd_funding(config: impl LineraNetConfig) -> Res .await?; // Setting up the application crowd funding - let deadline = Timestamp::from(std::u64::MAX); + let deadline = Timestamp::from(u64::MAX); let target = Amount::ONE; let state_crowd = InstantiationArgument { owner: account_owner1, diff --git a/linera-views/tests/queueview_tests.rs b/linera-views/tests/queueview_tests.rs index 695cba9ac6a..acc466ad887 100644 --- a/linera-views/tests/queueview_tests.rs +++ b/linera-views/tests/queueview_tests.rs @@ -73,7 +73,7 @@ async fn queue_view_mutability_check() { if choice == 4 { // Doing the rollback view.rollback(); - new_vector = vector.clone(); + new_vector.clone_from(&vector); } let new_elements = view.queue.elements().await.unwrap(); let new_hash = view.crypto_hash().await.unwrap(); @@ -86,7 +86,7 @@ async fn queue_view_mutability_check() { assert_eq!(new_elements, new_vector); } if save { - vector = new_vector.clone(); + vector.clone_from(&new_vector); view.save().await.unwrap(); } } diff --git a/toolchains/build/rust-toolchain.toml b/toolchains/build/rust-toolchain.toml index 6d7f5ac614c..344318028b3 100644 --- a/toolchains/build/rust-toolchain.toml +++ b/toolchains/build/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "1.77.2" +channel = "1.79.0" components = [ "clippy", "rustfmt", "rust-src" ] targets = [ "wasm32-unknown-unknown" ] profile = "minimal"