Fix errors from new 1.78 clippy lints

This commit is contained in:
Sashanoraa 2024-05-03 14:40:42 -04:00
parent 5da287fae4
commit b71cb0ea6c
11 changed files with 8 additions and 19 deletions

View File

@ -26,7 +26,6 @@ use std::sync::atomic::{AtomicU64, Ordering};
use std::time::{SystemTime, UNIX_EPOCH};
use thiserror::Error;
//////////////////////////////////////////////////////////////
///
struct Dirty<T>
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();

View File

@ -186,7 +186,6 @@ impl ServicesContext {
}
/////////////////////////////////////////////////////////////////////////////
///
pub(crate) struct VeilidCoreContext {
pub config: VeilidConfig,
pub update_callback: UpdateCallback,

View File

@ -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()) {

View File

@ -109,7 +109,6 @@ impl RawTcpNetworkConnection {
}
///////////////////////////////////////////////////////////
///
#[derive(Clone)]
pub(in crate::network_manager) struct RawTcpProtocolHandler

View File

@ -176,7 +176,6 @@ where
}
///////////////////////////////////////////////////////////
///
struct WebsocketProtocolHandlerArc {
tls: bool,
request_path: Vec<u8>,

View File

@ -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

View File

@ -1,7 +1,6 @@
use super::*;
/////////////////////////////////////////////////////////////////////////////////////////////////////
///
#[derive(Clone, Debug, PartialOrd, PartialEq, Eq, Ord, Serialize, Deserialize)]
pub struct SignedValueData {

View File

@ -1,7 +1,6 @@
use super::*;
/////////////////////////////////////////////////////////////////////////////////////////////////////
///
#[derive(Clone, PartialOrd, PartialEq, Eq, Ord, Serialize, Deserialize)]
pub struct SignedValueDescriptor {

View File

@ -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()

View File

@ -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 {

View File

@ -4,12 +4,10 @@ use std::io;
use task::{Context, Poll};
////////
///
trait SendStream: AsyncRead + AsyncWrite + Send + Unpin {}
impl<S> 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<dyn SendStream>,
peekbuf: Vec<u8>,