From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox 07/10] remove unnecessary return statement
Date: Tue, 3 Dec 2024 11:20:35 +0100 [thread overview]
Message-ID: <20241203102038.166031-7-m.sandoval@proxmox.com> (raw)
In-Reply-To: <20241203102038.166031-1-m.sandoval@proxmox.com>
Fixes the clippy lint:
```
warning: unneeded `return` statement
--> proxmox-time/src/week_days.rs:31:14
|
31 | _ => return Err(parse_error(text, "weekday")),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= note: `#[warn(clippy::needless_return)]` on by default
help: remove `return`
|
31 | _ => Err(parse_error(text, "weekday")),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
proxmox-apt/src/repositories/file/sources_parser.rs | 2 +-
proxmox-time/src/week_days.rs | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/proxmox-apt/src/repositories/file/sources_parser.rs b/proxmox-apt/src/repositories/file/sources_parser.rs
index 6d1eeb34..c85b8d2e 100644
--- a/proxmox-apt/src/repositories/file/sources_parser.rs
+++ b/proxmox-apt/src/repositories/file/sources_parser.rs
@@ -43,7 +43,7 @@ impl<R: BufRead> APTSourcesFileParser<R> {
if key.starts_with('-') {
return false;
};
- return key.chars().all(|c| matches!(c, '!'..='9' | ';'..='~'));
+ key.chars().all(|c| matches!(c, '!'..='9' | ';'..='~'))
}
/// Try parsing a repository in stanza format from `lines`.
diff --git a/proxmox-time/src/week_days.rs b/proxmox-time/src/week_days.rs
index da446c5b..c409d292 100644
--- a/proxmox-time/src/week_days.rs
+++ b/proxmox-time/src/week_days.rs
@@ -28,7 +28,7 @@ fn parse_weekday(i: &str) -> IResult<&str, WeekDays> {
"friday" | "fri" => Ok((i, WeekDays::FRIDAY)),
"saturday" | "sat" => Ok((i, WeekDays::SATURDAY)),
"sunday" | "sun" => Ok((i, WeekDays::SUNDAY)),
- _ => return Err(parse_error(text, "weekday")),
+ _ => Err(parse_error(text, "weekday")),
}
}
--
2.39.5
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
next prev parent reply other threads:[~2024-12-03 10:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-03 10:20 [pbs-devel] [PATCH proxmox 01/10] apt: file: Use unwrap_or_default instead of match Maximiliano Sandoval
2024-12-03 10:20 ` [pbs-devel] [PATCH proxmox 02/10] api: webhook: doc: add indentation to list item Maximiliano Sandoval
2024-12-03 10:20 ` [pbs-devel] [PATCH proxmox 03/10] apt: repositories: use if-let instead of match for Option Maximiliano Sandoval
2024-12-03 10:20 ` [pbs-devel] [PATCH proxmox 04/10] router: parsing: docs: fix Records::from link Maximiliano Sandoval
2024-12-03 10:20 ` [pbs-devel] [PATCH proxmox 05/10] router: parsing: docs: fix 'instead' typo Maximiliano Sandoval
2024-12-03 10:20 ` [pbs-devel] [PATCH proxmox 06/10] elide lifetimes where possible Maximiliano Sandoval
2024-12-03 10:20 ` Maximiliano Sandoval [this message]
2024-12-03 10:20 ` [pbs-devel] [PATCH proxmox 08/10] docs: remove empty lines in docs Maximiliano Sandoval
2024-12-03 10:20 ` [pbs-devel] [PATCH proxmox 09/10] sys: systemd: remove empty line after outer attribute Maximiliano Sandoval
2024-12-03 10:20 ` [pbs-devel] [PATCH proxmox 10/10] apt: repositories: remove unnecessary if-let in iterator Maximiliano Sandoval
2024-12-03 13:30 ` [pbs-devel] applied-seires: " Fabian Grünbichler
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=20241203102038.166031-7-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