From a1469d416b46a678e8b2387f7433711e13c93d37 Mon Sep 17 00:00:00 2001 From: jeffgrunewald Date: Tue, 23 Jul 2024 10:18:56 -0400 Subject: [PATCH] update rust to 1.79; fix warnings --- crates/dscvr-canister-config/src/schema/dfx.rs | 4 ++-- crates/dscvr-canister-config/src/schema/dscvr.rs | 4 ++-- crates/ic-canister-logger/src/lib.rs | 3 +++ rust-toolchain.toml | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/crates/dscvr-canister-config/src/schema/dfx.rs b/crates/dscvr-canister-config/src/schema/dfx.rs index 1efe919..68cc221 100644 --- a/crates/dscvr-canister-config/src/schema/dfx.rs +++ b/crates/dscvr-canister-config/src/schema/dfx.rs @@ -151,10 +151,10 @@ impl DfxConfig { fn update_names(&mut self) { for (k, val) in self.canisters.iter_mut() { - val.name = k.clone(); + val.name.clone_from(k); } for (k, val) in self.networks.iter_mut() { - val.name = k.clone(); + val.name.clone_from(k); } } diff --git a/crates/dscvr-canister-config/src/schema/dscvr.rs b/crates/dscvr-canister-config/src/schema/dscvr.rs index fbe7c2e..2f5eff8 100644 --- a/crates/dscvr-canister-config/src/schema/dscvr.rs +++ b/crates/dscvr-canister-config/src/schema/dscvr.rs @@ -111,8 +111,8 @@ impl DSCVRConfig { .and_then(|canister_network| canister_network.provisioned_instances.clone()); for (name, network) in canister.networks.iter_mut() { if copy_to_all || network_name.as_ref().unwrap() == name { - network.available_instances = available.clone(); - network.provisioned_instances = provisioned.clone(); + network.available_instances.clone_from(&available); + network.provisioned_instances.clone_from(&provisioned); } } } diff --git a/crates/ic-canister-logger/src/lib.rs b/crates/ic-canister-logger/src/lib.rs index a2ec519..a1dc4af 100644 --- a/crates/ic-canister-logger/src/lib.rs +++ b/crates/ic-canister-logger/src/lib.rs @@ -7,6 +7,7 @@ use tracing_subscriber::fmt::time::FormatTime; pub mod scoped_instruction_counter; +#[allow(dead_code)] struct IcStdout; impl Write for IcStdout { @@ -27,8 +28,10 @@ impl Write for IcStdout { } } +#[allow(dead_code)] struct IcTimer; +#[allow(dead_code)] #[cfg(not(target_arch = "wasm32"))] fn current_time_nanos() -> u64 { time::OffsetDateTime::now_utc().unix_timestamp_nanos() as u64 diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 41d80b8..756e027 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.77.2" +channel = "1.79.0" components = ["rustfmt", "clippy"] targets = ["wasm32-unknown-unknown"]