[pve-devel] [PATCH proxmox-perl-rs 3/3] pve: tfa: write char comparison more succinctly

Maximiliano Sandoval m.sandoval at proxmox.com
Mon Mar 10 10:39:04 CET 2025


Fixes the manual_pattern_char_comparison clippy lint.

Signed-off-by: Maximiliano Sandoval <m.sandoval at proxmox.com>
---
 pve-rs/src/tfa.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pve-rs/src/tfa.rs b/pve-rs/src/tfa.rs
index 66dca3d..2cd7396 100644
--- a/pve-rs/src/tfa.rs
+++ b/pve-rs/src/tfa.rs
@@ -726,7 +726,7 @@ fn decode_old_oath_entry(
     let mut out = Vec::new();
 
     let keys = take_json_string(&mut obj, "keys", "oath")?;
-    for key in keys.split(|c| c == ',' || c == ';' || c == ' ') {
+    for key in keys.split([',', ';', ' ']) {
         let key = trim_ascii_whitespace(key.as_bytes());
         if key.is_empty() {
             continue;
@@ -765,7 +765,7 @@ fn decode_old_yubico_entry(data: JsonValue) -> Result<Vec<String>, Error> {
     let mut out = Vec::new();
 
     let keys = take_json_string(&mut obj, "keys", "yubico")?;
-    for key in keys.split(|c| c == ',' || c == ';' || c == ' ') {
+    for key in keys.split([',', ';', ' ']) {
         let key = trim_ascii_whitespace(key.as_bytes());
         if key.is_empty() {
             continue;
-- 
2.39.5





More information about the pve-devel mailing list