public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox 2/6] remove needless_borrow
Date: Wed, 28 Feb 2024 12:39:16 +0100	[thread overview]
Message-ID: <20240228113920.302844-2-m.sandoval@proxmox.com> (raw)
In-Reply-To: <20240228113920.302844-1-m.sandoval@proxmox.com>

Fixes the clippy lint

    warning: this expression creates a reference which is immediately dereferenced by the compiler
       --> proxmox-api-macro/src/util.rs:868:25
        |
    868 |     duplicate(&*target, &path);
        |                         ^^^^^ help: change this to: `path`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
        = note: `#[warn(clippy::needless_borrow)]` on by default

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
 proxmox-api-macro/src/util.rs          | 2 +-
 proxmox-rest-server/src/worker_task.rs | 2 +-
 proxmox-schema/src/de/no_schema.rs     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/proxmox-api-macro/src/util.rs b/proxmox-api-macro/src/util.rs
index 324c460d..428b1e4d 100644
--- a/proxmox-api-macro/src/util.rs
+++ b/proxmox-api-macro/src/util.rs
@@ -865,7 +865,7 @@ pub fn parse_str_value_to_option<T: Parse>(
     path: &syn::Path,
     nv: syn::parse::ParseStream<'_>,
 ) {
-    duplicate(&*target, &path);
+    duplicate(&*target, path);
     match nv.parse().and_then(|lit| parse_lit_str(&lit)) {
         Ok(value) => *target = Some(value),
         Err(err) => crate::add_error(err),
diff --git a/proxmox-rest-server/src/worker_task.rs b/proxmox-rest-server/src/worker_task.rs
index 4cf24cc4..5bab4cdc 100644
--- a/proxmox-rest-server/src/worker_task.rs
+++ b/proxmox-rest-server/src/worker_task.rs
@@ -850,7 +850,7 @@ impl WorkerTask {
             file_opts: setup.file_opts.clone(),
             ..Default::default()
         };
-        let logger = FileLogger::new(&path, logger_options)?;
+        let logger = FileLogger::new(path, logger_options)?;
 
         let worker = Arc::new(Self {
             setup,
diff --git a/proxmox-schema/src/de/no_schema.rs b/proxmox-schema/src/de/no_schema.rs
index 546e5001..45fe08cd 100644
--- a/proxmox-schema/src/de/no_schema.rs
+++ b/proxmox-schema/src/de/no_schema.rs
@@ -303,7 +303,7 @@ impl<'a> Iterator for SplitList<'a> {
     type Item = &'a str;
 
     fn next(&mut self) -> Option<&'a str> {
-        let range = super::next_str_entry(&self.input, &mut self.at, self.has_null)?;
+        let range = super::next_str_entry(self.input, &mut self.at, self.has_null)?;
         Some(&self.input[range])
     }
 }
-- 
2.39.2





  reply	other threads:[~2024-02-28 11:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-28 11:39 [pbs-devel] [PATCH proxmox 1/6] acme: Default `impl` can be derived Maximiliano Sandoval
2024-02-28 11:39 ` Maximiliano Sandoval [this message]
2024-02-28 11:39 ` [pbs-devel] [PATCH proxmox 3/6] io: remove unnecesary cast to *mut u8 Maximiliano Sandoval
2024-02-28 11:39 ` [pbs-devel] [PATCH proxmox 4/6] schema: de: don't use while where we don't loop Maximiliano Sandoval
2024-02-28 11:39 ` [pbs-devel] [PATCH proxmox 5/6] rest: do not convert string to string Maximiliano Sandoval
2024-02-28 11:39 ` [pbs-devel] [PATCH proxmox 6/6] rrd: use unwrap_or_default when possible Maximiliano Sandoval

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=20240228113920.302844-2-m.sandoval@proxmox.com \
    --to=m.sandoval@proxmox.com \
    --cc=pbs-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal