all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Mira Limbeck <m.limbeck@proxmox.com>
To: pmg-devel@lists.proxmox.com
Subject: [pmg-devel] [PATCH v3 pmg-log-tracker 5/5] cleanup: fix clippy warnings
Date: Tue, 20 Feb 2024 11:06:48 +0100	[thread overview]
Message-ID: <20240220100648.44119-5-m.limbeck@proxmox.com> (raw)
In-Reply-To: <20240220100648.44119-1-m.limbeck@proxmox.com>

Signed-off-by: Mira Limbeck <m.limbeck@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




  parent reply	other threads:[~2024-02-20 10:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-20 10:06 [pmg-devel] [PATCH v3 pmg-log-tracker 1/5] rfc3339: move timezone offset compatibility code to old time parser Mira Limbeck
2024-02-20 10:06 ` [pmg-devel] [PATCH v3 pmg-log-tracker 2/5] tests: improve test output consistency Mira Limbeck
2024-02-20 10:06 ` [pmg-devel] [PATCH v3 pmg-log-tracker 3/5] tests: update for log tracker time handling changes Mira Limbeck
2024-02-20 10:06 ` [pmg-devel] [PATCH v3 pmg-log-tracker 4/5] cleanup: remove unused strftime function Mira Limbeck
2024-02-20 10:06 ` Mira Limbeck [this message]
2024-02-20 10:06 ` [pmg-devel] [PATCH v3 pmg-api] MailTracker: remove timezone offset Mira Limbeck
2024-02-22 12:25 ` [pmg-devel] [PATCH v3 pmg-log-tracker 1/5] rfc3339: move timezone offset compatibility code to old time parser Dominik Csapak
2024-02-27 14:07 ` [pmg-devel] applied-series: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240220100648.44119-5-m.limbeck@proxmox.com \
    --to=m.limbeck@proxmox.com \
    --cc=pmg-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal