[pmg-devel] [PATCH v2 5/5] cleanup: fix clippy warnings

Mira Limbeck m.limbeck at proxmox.com
Mon Feb 19 18:55:47 CET 2024


Signed-off-by: Mira Limbeck <m.limbeck at proxmox.com>
---
 src/main.rs | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/main.rs b/src/main.rs
index 82d5657..26dc720 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() {
@@ -2371,7 +2367,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