From c363123d9bae9c074073ed6840d1f4db35e2f7e7 Mon Sep 17 00:00:00 2001 From: Mira Limbeck Date: Tue, 20 Feb 2024 11:06:48 +0100 Subject: [PATCH] cleanup: fix clippy warnings Signed-off-by: Mira Limbeck --- src/main.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index 5d4f86e..0a4f192 100644 --- a/src/main.rs +++ b/src/main.rs @@ -748,8 +748,9 @@ impl Default for ToEntry { } } -#[derive(Debug, PartialEq, Copy, Clone)] +#[derive(Debug, PartialEq, Copy, Clone, Default)] enum DStatus { + #[default] Invalid, Accept, Quarantine, @@ -762,12 +763,6 @@ enum DStatus { Dsn(u32), } -impl Default for DStatus { - fn default() -> Self { - DStatus::Invalid - } -} - impl std::fmt::Display for DStatus { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let c = match self { @@ -1314,6 +1309,7 @@ impl QEntry { true } + #[allow(clippy::wrong_self_convention)] fn from_to_matches(&mut self, parser: &Parser) -> bool { if !parser.options.from.is_empty() { if self.from.is_empty() { @@ -2368,7 +2364,7 @@ fn parse_host_service_pid(data: &[u8]) -> Option<(ByteSlice, ByteSlice, u64, Byt .count(); let service = &data[0..service_count]; let data = &data[service_count..]; - if data.get(0) != Some(&b'[') { + if data.first() != Some(&b'[') { return None; } let data = &data[1..];