From aeebe2a596d6b2c2554bee0dcade7cbca10087b9 Mon Sep 17 00:00:00 2001 From: Christien Rioux Date: Sun, 30 Jun 2024 09:40:20 -0400 Subject: [PATCH] clippy fixes --- veilid-cli/src/log_viewer_ui.rs | 4 ++-- veilid-cli/src/main.rs | 2 ++ veilid-cli/src/settings.rs | 6 +++--- veilid-core/src/rpc_processor/mod.rs | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/veilid-cli/src/log_viewer_ui.rs b/veilid-cli/src/log_viewer_ui.rs index bf02f451..696cefe4 100644 --- a/veilid-cli/src/log_viewer_ui.rs +++ b/veilid-cli/src/log_viewer_ui.rs @@ -205,7 +205,7 @@ impl UISender for LogViewerUISender { fn display_string_dialog(&self, title: &str, text: &str, close_cb: UICallback) { println!("{}: {}", title, text); - if let UICallback::Interactive(mut close_cb) = close_cb { + if let UICallback::LogViewer(mut close_cb) = close_cb { close_cb() } } @@ -215,7 +215,7 @@ impl UISender for LogViewerUISender { } fn send_callback(&self, callback: UICallback) { - if let UICallback::Interactive(mut callback) = callback { + if let UICallback::LogViewer(mut callback) = callback { callback(); } } diff --git a/veilid-cli/src/main.rs b/veilid-cli/src/main.rs index f3b0e5c4..836a7a66 100644 --- a/veilid-cli/src/main.rs +++ b/veilid-cli/src/main.rs @@ -216,6 +216,7 @@ fn main() -> Result<(), String> { .suppress_timestamp(), uisender.as_logwriter().unwrap(), ) + .o_append(settings.logging.file.append) .start() .expect("failed to initialize logger!"); } else { @@ -233,6 +234,7 @@ fn main() -> Result<(), String> { .directory(settings.logging.file.directory.clone()) .suppress_timestamp(), ) + .o_append(settings.logging.file.append) .start() .expect("failed to initialize logger!"); } diff --git a/veilid-cli/src/settings.rs b/veilid-cli/src/settings.rs index 023e7e68..550dc123 100644 --- a/veilid-cli/src/settings.rs +++ b/veilid-cli/src/settings.rs @@ -120,7 +120,7 @@ pub fn convert_loglevel(log_level: LogLevel) -> log::LevelFilter { #[derive(Debug, Clone)] pub struct NamedSocketAddrs { - pub name: String, + pub _name: String, pub addrs: Vec, } @@ -130,7 +130,7 @@ impl TryFrom for NamedSocketAddrs { fn try_from(value: String) -> Result { let addrs = value.to_socket_addrs()?.collect(); let name = value; - Ok(NamedSocketAddrs { name, addrs }) + Ok(NamedSocketAddrs { _name: name, addrs }) } } @@ -142,7 +142,7 @@ impl<'de> serde::Deserialize<'de> for NamedSocketAddrs { let s = String::deserialize(deserializer)?; let addr_iter = s.to_socket_addrs().map_err(serde::de::Error::custom)?; Ok(NamedSocketAddrs { - name: s, + _name: s, addrs: addr_iter.collect(), }) } diff --git a/veilid-core/src/rpc_processor/mod.rs b/veilid-core/src/rpc_processor/mod.rs index 60234b05..40e4eaa8 100644 --- a/veilid-core/src/rpc_processor/mod.rs +++ b/veilid-core/src/rpc_processor/mod.rs @@ -200,7 +200,7 @@ struct WaitableReply { #[derive(Clone, Debug, Default)] pub struct Answer { /// Hpw long it took to get this answer - pub latency: TimestampDuration, + pub _latency: TimestampDuration, /// The private route requested to receive the reply pub reply_private_route: Option, /// The answer itself @@ -208,7 +208,7 @@ pub struct Answer { } impl Answer { pub fn new(latency: TimestampDuration, reply_private_route: Option, answer: T) -> Self { - Self { latency, reply_private_route, answer } + Self { _latency: latency, reply_private_route, answer } } }