From 0816e07a5d3182d09f755c9f3952396966dd8e0f Mon Sep 17 00:00:00 2001 From: auronandace Date: Fri, 12 Jun 2026 17:25:53 +0100 Subject: [PATCH] replace an explicit return with question mark --- src/header/crypt/sha.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/header/crypt/sha.rs b/src/header/crypt/sha.rs index 01b339f944..530d98d5e7 100644 --- a/src/header/crypt/sha.rs +++ b/src/header/crypt/sha.rs @@ -80,15 +80,14 @@ pub fn crypt_sha(passw: &[u8], setting: &str, cipher: ShaType) -> Option if setting.get(cursor..cursor + 7) == Some(RSTRING) { cursor += 7; has_round = true; - if let Some(c_end) = setting[cursor..].chars().position(|r| r == '$') { + { + let c_end = setting[cursor..].chars().position(|r| r == '$')?; if let Ok(u) = setting[cursor..cursor + c_end].parse::() { cursor += c_end + 1; rounds = u.min(ROUNDS_MAX as c_ulong).max(ROUNDS_MIN as c_ulong); } else { return None; } - } else { - return None; } } else { has_round = false;