diff --git a/veilid-cli/src/cursive_ui.rs b/veilid-cli/src/cursive_ui.rs index 7ce43094..01c3af66 100644 --- a/veilid-cli/src/cursive_ui.rs +++ b/veilid-cli/src/cursive_ui.rs @@ -26,7 +26,6 @@ use std::sync::atomic::{AtomicU64, Ordering}; use std::time::{SystemTime, UNIX_EPOCH}; use thiserror::Error; ////////////////////////////////////////////////////////////// -/// struct Dirty where T: PartialEq, @@ -373,7 +372,7 @@ impl CursiveUI { // save edited command to newest history slot let hlen = inner.cmd_history.len(); inner.cmd_history_position = hlen - 1; - inner.cmd_history[hlen - 1] = text.to_owned(); + text.clone_into(&mut inner.cmd_history[hlen - 1]); } fn enable_command_ui(s: &mut Cursive, enabled: bool) { @@ -465,7 +464,7 @@ impl CursiveUI { let mut inner = Self::inner_mut(s); let hlen = inner.cmd_history.len(); - inner.cmd_history[hlen - 1] = text.to_owned(); + text.clone_into(&mut inner.cmd_history[hlen - 1]); if hlen >= 2 && inner.cmd_history[hlen - 1] == inner.cmd_history[hlen - 2] { inner.cmd_history[hlen - 1] = "".to_string(); diff --git a/veilid-core/src/core_context.rs b/veilid-core/src/core_context.rs index 851da71e..6a34f289 100644 --- a/veilid-core/src/core_context.rs +++ b/veilid-core/src/core_context.rs @@ -186,7 +186,6 @@ impl ServicesContext { } ///////////////////////////////////////////////////////////////////////////// -/// pub(crate) struct VeilidCoreContext { pub config: VeilidConfig, pub update_callback: UpdateCallback, diff --git a/veilid-core/src/network_manager/connection_table.rs b/veilid-core/src/network_manager/connection_table.rs index 3b2b7173..c70a52d9 100644 --- a/veilid-core/src/network_manager/connection_table.rs +++ b/veilid-core/src/network_manager/connection_table.rs @@ -166,7 +166,7 @@ impl ConnectionTable { if inner.conn_by_id[protocol_index].contains_key(&id) { panic!("duplicate connection id: {:#?}", network_connection); } - if inner.protocol_index_by_id.get(&id).is_some() { + if inner.protocol_index_by_id.contains_key(&id) { panic!("duplicate id to protocol index: {:#?}", network_connection); } if let Some(ids) = inner.ids_by_remote.get(&flow.remote()) { diff --git a/veilid-core/src/network_manager/native/protocol/tcp.rs b/veilid-core/src/network_manager/native/protocol/tcp.rs index 17bb53b6..0f213317 100644 --- a/veilid-core/src/network_manager/native/protocol/tcp.rs +++ b/veilid-core/src/network_manager/native/protocol/tcp.rs @@ -109,7 +109,6 @@ impl RawTcpNetworkConnection { } /////////////////////////////////////////////////////////// -/// #[derive(Clone)] pub(in crate::network_manager) struct RawTcpProtocolHandler diff --git a/veilid-core/src/network_manager/native/protocol/ws.rs b/veilid-core/src/network_manager/native/protocol/ws.rs index c9aad682..cfab7ff5 100644 --- a/veilid-core/src/network_manager/native/protocol/ws.rs +++ b/veilid-core/src/network_manager/native/protocol/ws.rs @@ -176,7 +176,6 @@ where } /////////////////////////////////////////////////////////// -/// struct WebsocketProtocolHandlerArc { tls: bool, request_path: Vec, diff --git a/veilid-core/src/network_manager/native/start_protocols.rs b/veilid-core/src/network_manager/native/start_protocols.rs index 50af8087..bd428f0c 100644 --- a/veilid-core/src/network_manager/native/start_protocols.rs +++ b/veilid-core/src/network_manager/native/start_protocols.rs @@ -295,7 +295,7 @@ impl Network { if split_url.scheme.to_ascii_lowercase() != "ws" { bail!("WS URL must use 'ws://' scheme"); } - split_url.scheme = "ws".to_owned(); + "ws".clone_into(&mut split_url.scheme); // Resolve static public hostnames let global_socket_addrs = split_url @@ -413,7 +413,7 @@ impl Network { if split_url.scheme.to_ascii_lowercase() != "wss" { bail!("WSS URL must use 'wss://' scheme"); } - split_url.scheme = "wss".to_owned(); + "wss".clone_into(&mut split_url.scheme); // Resolve static public hostnames let global_socket_addrs = split_url diff --git a/veilid-core/src/storage_manager/types/signed_value_data.rs b/veilid-core/src/storage_manager/types/signed_value_data.rs index ed766389..ea1e8ec6 100644 --- a/veilid-core/src/storage_manager/types/signed_value_data.rs +++ b/veilid-core/src/storage_manager/types/signed_value_data.rs @@ -1,7 +1,6 @@ use super::*; ///////////////////////////////////////////////////////////////////////////////////////////////////// -/// #[derive(Clone, Debug, PartialOrd, PartialEq, Eq, Ord, Serialize, Deserialize)] pub struct SignedValueData { diff --git a/veilid-core/src/storage_manager/types/signed_value_descriptor.rs b/veilid-core/src/storage_manager/types/signed_value_descriptor.rs index 2a7b8428..0a10a383 100644 --- a/veilid-core/src/storage_manager/types/signed_value_descriptor.rs +++ b/veilid-core/src/storage_manager/types/signed_value_descriptor.rs @@ -1,7 +1,6 @@ use super::*; ///////////////////////////////////////////////////////////////////////////////////////////////////// -/// #[derive(Clone, PartialOrd, PartialEq, Eq, Ord, Serialize, Deserialize)] pub struct SignedValueDescriptor { diff --git a/veilid-core/src/table_store/mod.rs b/veilid-core/src/table_store/mod.rs index 4cfa1fc0..699a8d69 100644 --- a/veilid-core/src/table_store/mod.rs +++ b/veilid-core/src/table_store/mod.rs @@ -313,8 +313,7 @@ impl TableStore { log_tstore!(debug "changing dek password"); self.config .with_mut(|c| { - c.protected_store.device_encryption_key_password = - new_device_encryption_key_password.clone(); + c.protected_store.device_encryption_key_password.clone_from(&new_device_encryption_key_password); Ok(new_device_encryption_key_password) }) .unwrap() diff --git a/veilid-core/src/veilid_config.rs b/veilid-core/src/veilid_config.rs index 22a99aee..daa1d586 100644 --- a/veilid-core/src/veilid_config.rs +++ b/veilid-core/src/veilid_config.rs @@ -918,7 +918,7 @@ impl VeilidConfig { // Remove secrets safe_cfg.network.routing_table.node_id_secret = TypedSecretGroup::new(); - safe_cfg.protected_store.device_encryption_key_password = "".to_owned(); + "".clone_into(&mut safe_cfg.protected_store.device_encryption_key_password); safe_cfg.protected_store.new_device_encryption_key_password = None; safe_cfg @@ -929,7 +929,7 @@ impl VeilidConfig { // Remove secrets safe_cfg.network.routing_table.node_id_secret = TypedSecretGroup::new(); - safe_cfg.protected_store.device_encryption_key_password = "".to_owned(); + "".clone_into(&mut safe_cfg.protected_store.device_encryption_key_password); safe_cfg.protected_store.new_device_encryption_key_password = None; VeilidConfig { diff --git a/veilid-tools/src/async_peek_stream.rs b/veilid-tools/src/async_peek_stream.rs index 26b15962..19bd490d 100644 --- a/veilid-tools/src/async_peek_stream.rs +++ b/veilid-tools/src/async_peek_stream.rs @@ -4,12 +4,10 @@ use std::io; use task::{Context, Poll}; //////// -/// trait SendStream: AsyncRead + AsyncWrite + Send + Unpin {} impl SendStream for S where S: AsyncRead + AsyncWrite + Send + Unpin + 'static {} //////// -/// pub struct Peek<'a> { aps: AsyncPeekStream, @@ -55,7 +53,6 @@ impl Future for Peek<'_> { } //////// -/// pub struct PeekExact<'a> { aps: AsyncPeekStream, @@ -106,7 +103,6 @@ impl Future for PeekExact<'_> { } } ///////// -/// struct AsyncPeekStreamInner { stream: Box, peekbuf: Vec,