From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup-qemu 3/6] clippy fix: shorten bool->i32 conversion
Date: Mon, 12 Dec 2022 13:05:38 +0100 [thread overview]
Message-ID: <20221212120541.1909975-4-f.gruenbichler@proxmox.com> (raw)
In-Reply-To: <20221212120541.1909975-1-f.gruenbichler@proxmox.com>
i32 implements From<bool> with the desired semantics, this still makes it
obvious that the conversion happens, although a plain `.into()` would also
work.
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
---
src/lib.rs | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/src/lib.rs b/src/lib.rs
index ee842ce..bdd162b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -417,13 +417,7 @@ pub extern "C" fn proxmox_backup_check_incremental(
match tools::utf8_c_string_lossy(device_name) {
None => 0,
- Some(device_name) => {
- if task.check_incremental(device_name, size) {
- 1
- } else {
- 0
- }
- }
+ Some(device_name) => i32::from(task.check_incremental(device_name, size)),
}
}
--
2.30.2
next prev parent reply other threads:[~2022-12-12 12:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-12 12:05 [pbs-devel] [PATCH proxmox-backup-qemu 0/6] update to current PBS/dependencies Fabian Grünbichler
2022-12-12 12:05 ` [pbs-devel] [PATCH proxmox-backup-qemu 1/6] update dependencies Fabian Grünbichler
2022-12-12 13:41 ` [pbs-devel] [PATCH FIXUP proxmox-backup-qemu] fixup: update to current PBS head Fabian Grünbichler
2022-12-12 12:05 ` [pbs-devel] [PATCH proxmox-backup-qemu 2/6] clippy fixes Fabian Grünbichler
2022-12-12 12:05 ` Fabian Grünbichler [this message]
2022-12-12 12:05 ` [pbs-devel] [RFC proxmox-backup-qemu 4/6] lint fix: explicitly drop Box Fabian Grünbichler
2022-12-12 12:05 ` [pbs-devel] [PATCH proxmox-backup-qemu 5/6] update edition to 2021 Fabian Grünbichler
2022-12-12 12:05 ` [pbs-devel] [PATCH proxmox-backup-qemu 6/6] bump version to 1.3.2-1 and update symbols file Fabian Grünbichler
2022-12-12 14:14 ` [pbs-devel] applied-series: [PATCH proxmox-backup-qemu 0/6] update to current PBS/dependencies Wolfgang Bumiller
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=20221212120541.1909975-4-f.gruenbichler@proxmox.com \
--to=f.gruenbichler@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 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.