clippy fixes

This commit is contained in:
Christien Rioux 2024-06-30 09:40:20 -04:00
parent beeeedbfac
commit aeebe2a596
4 changed files with 9 additions and 7 deletions

View File

@ -205,7 +205,7 @@ impl UISender for LogViewerUISender {
fn display_string_dialog(&self, title: &str, text: &str, close_cb: UICallback) { fn display_string_dialog(&self, title: &str, text: &str, close_cb: UICallback) {
println!("{}: {}", title, text); println!("{}: {}", title, text);
if let UICallback::Interactive(mut close_cb) = close_cb { if let UICallback::LogViewer(mut close_cb) = close_cb {
close_cb() close_cb()
} }
} }
@ -215,7 +215,7 @@ impl UISender for LogViewerUISender {
} }
fn send_callback(&self, callback: UICallback) { fn send_callback(&self, callback: UICallback) {
if let UICallback::Interactive(mut callback) = callback { if let UICallback::LogViewer(mut callback) = callback {
callback(); callback();
} }
} }

View File

@ -216,6 +216,7 @@ fn main() -> Result<(), String> {
.suppress_timestamp(), .suppress_timestamp(),
uisender.as_logwriter().unwrap(), uisender.as_logwriter().unwrap(),
) )
.o_append(settings.logging.file.append)
.start() .start()
.expect("failed to initialize logger!"); .expect("failed to initialize logger!");
} else { } else {
@ -233,6 +234,7 @@ fn main() -> Result<(), String> {
.directory(settings.logging.file.directory.clone()) .directory(settings.logging.file.directory.clone())
.suppress_timestamp(), .suppress_timestamp(),
) )
.o_append(settings.logging.file.append)
.start() .start()
.expect("failed to initialize logger!"); .expect("failed to initialize logger!");
} }

View File

@ -120,7 +120,7 @@ pub fn convert_loglevel(log_level: LogLevel) -> log::LevelFilter {
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct NamedSocketAddrs { pub struct NamedSocketAddrs {
pub name: String, pub _name: String,
pub addrs: Vec<SocketAddr>, pub addrs: Vec<SocketAddr>,
} }
@ -130,7 +130,7 @@ impl TryFrom<String> for NamedSocketAddrs {
fn try_from(value: String) -> Result<Self, Self::Error> { fn try_from(value: String) -> Result<Self, Self::Error> {
let addrs = value.to_socket_addrs()?.collect(); let addrs = value.to_socket_addrs()?.collect();
let name = value; 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 s = String::deserialize(deserializer)?;
let addr_iter = s.to_socket_addrs().map_err(serde::de::Error::custom)?; let addr_iter = s.to_socket_addrs().map_err(serde::de::Error::custom)?;
Ok(NamedSocketAddrs { Ok(NamedSocketAddrs {
name: s, _name: s,
addrs: addr_iter.collect(), addrs: addr_iter.collect(),
}) })
} }

View File

@ -200,7 +200,7 @@ struct WaitableReply {
#[derive(Clone, Debug, Default)] #[derive(Clone, Debug, Default)]
pub struct Answer<T> { pub struct Answer<T> {
/// Hpw long it took to get this answer /// Hpw long it took to get this answer
pub latency: TimestampDuration, pub _latency: TimestampDuration,
/// The private route requested to receive the reply /// The private route requested to receive the reply
pub reply_private_route: Option<PublicKey>, pub reply_private_route: Option<PublicKey>,
/// The answer itself /// The answer itself
@ -208,7 +208,7 @@ pub struct Answer<T> {
} }
impl<T> Answer<T> { impl<T> Answer<T> {
pub fn new(latency: TimestampDuration, reply_private_route: Option<PublicKey>, answer: T) -> Self { pub fn new(latency: TimestampDuration, reply_private_route: Option<PublicKey>, answer: T) -> Self {
Self { latency, reply_private_route, answer } Self { _latency: latency, reply_private_route, answer }
} }
} }