From 20c0a919c596046cc714181bd9d6e12e093823e5 Mon Sep 17 00:00:00 2001 From: Niklas Elsbrock Date: Sun, 10 May 2026 18:13:47 +0200 Subject: [PATCH] refactor: replace `with_context` calls with `context` calls --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 389e9a2..5fd25ad 100644 --- a/src/main.rs +++ b/src/main.rs @@ -100,12 +100,13 @@ fn main() -> anyhow::Result<()> { let password = rpassword::prompt_password( "Enter password for encrypting found keys (leave empty for no encryption): ", ) - .with_context(|| "Failed to prompt password")?; + .context("Failed to prompt password")?; + if password.is_empty() { None } else { let password_retype = rpassword::prompt_password("Retype password: ") - .with_context(|| "Failed to prompt password retype")?; + .context("Failed to prompt password retype")?; if password_retype == password { Some(password.into()) } else {