mirror of
https://github.com/nelsbrock/fingerprunk.git
synced 2026-08-14 16:12:08 +02:00
refactor: replace with_context calls with context calls
This commit is contained in:
+3
-2
@@ -100,12 +100,13 @@ fn main() -> anyhow::Result<()> {
|
|||||||
let password = rpassword::prompt_password(
|
let password = rpassword::prompt_password(
|
||||||
"Enter password for encrypting found keys (leave empty for no encryption): ",
|
"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() {
|
if password.is_empty() {
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
let password_retype = rpassword::prompt_password("Retype password: ")
|
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 {
|
if password_retype == password {
|
||||||
Some(password.into())
|
Some(password.into())
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user