[pmg-devel] [PATCH v3 pmg-log-tracker 5/5] cleanup: fix clippy warnings

Mira Limbeck m.limbeck at proxmox.com
Tue Feb 20 11:06:48 CET 2024


Signed-off-by: Mira Limbeck <m.limbeck at proxmox.com>
---
v3:
 - added `pmg-log-tracker` to subject

 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..];
-- 
2.39.2




More information about the pmg-devel mailing list