From: Lukas Wagner <l.wagner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox 2/2] tree-wide: clippy fixes
Date: Tue, 5 Dec 2023 13:31:15 +0100 [thread overview]
Message-ID: <20231205123115.187815-2-l.wagner@proxmox.com> (raw)
In-Reply-To: <20231205123115.187815-1-l.wagner@proxmox.com>
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
proxmox-acme/src/order.rs | 9 ++-------
proxmox-api-macro/src/util.rs | 2 +-
proxmox-rest-server/src/rest.rs | 2 +-
proxmox-rest-server/src/worker_task.rs | 2 +-
4 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/proxmox-acme/src/order.rs b/proxmox-acme/src/order.rs
index 404d4ae..97c068c 100644
--- a/proxmox-acme/src/order.rs
+++ b/proxmox-acme/src/order.rs
@@ -7,11 +7,12 @@ use crate::request::Request;
use crate::Error;
/// Status of an [`Order`].
-#[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize, Serialize)]
+#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum Status {
/// Invalid, used as a place holder for when sending objects as contrary to account creation,
/// the Acme RFC does not require the server to ignore unknown parts of the `Order` object.
+ #[default]
New,
/// Authorization failed and it is now invalid.
@@ -33,12 +34,6 @@ pub enum Status {
Valid,
}
-impl Default for Status {
- fn default() -> Self {
- Status::New
- }
-}
-
impl Status {
/// Serde helper
fn is_new(&self) -> bool {
diff --git a/proxmox-api-macro/src/util.rs b/proxmox-api-macro/src/util.rs
index 324c460..428b1e4 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/rest.rs b/proxmox-rest-server/src/rest.rs
index 39f98e5..25cafb2 100644
--- a/proxmox-rest-server/src/rest.rs
+++ b/proxmox-rest-server/src/rest.rs
@@ -155,7 +155,7 @@ impl Service<Request<Body>> for RedirectService {
Response::builder()
.status(status_code)
- .header("Location", String::from(location_value))
+ .header("Location", location_value)
.body(Body::empty())?
} else {
Response::builder()
diff --git a/proxmox-rest-server/src/worker_task.rs b/proxmox-rest-server/src/worker_task.rs
index 4cf24cc..5bab4cd 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,
--
2.39.2
prev parent reply other threads:[~2023-12-05 12:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-05 12:31 [pbs-devel] [PATCH proxmox 1/2] tree-wide: format code using `cargo fmt` Lukas Wagner
2023-12-05 12:31 ` Lukas Wagner [this message]
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=20231205123115.187815-2-l.wagner@proxmox.com \
--to=l.wagner@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