diff --git a/crates/rustic_core/src/repository.rs b/crates/rustic_core/src/repository.rs index 1eb5b43..de8cf31 100644 --- a/crates/rustic_core/src/repository.rs +++ b/crates/rustic_core/src/repository.rs @@ -9,6 +9,7 @@ use std::{ use bytes::Bytes; use log::{debug, error, info}; +use dialoguer::Password; use nom::{ branch::alt, bytes::complete::{is_not, tag}, @@ -18,7 +19,6 @@ use nom::{ sequence::delimited, IResult, }; -use dialoguer::Password; use serde_with::{serde_as, DisplayFromStr}; diff --git a/src/commands/init.rs b/src/commands/init.rs index 350637d..2470034 100644 --- a/src/commands/init.rs +++ b/src/commands/init.rs @@ -80,10 +80,11 @@ pub(crate) fn save_config( let key = Key::new(); let pass = password.map_or_else( - || match Password::new().with_prompt("enter password for new key") - .allow_empty_password(true) - .with_confirmation("confirm password", "passwords do not match") - .interact() + || match Password::new() + .with_prompt("enter password for new key") + .allow_empty_password(true) + .with_confirmation("confirm password", "passwords do not match") + .interact() { Ok(it) => it, Err(err) => { diff --git a/src/commands/key.rs b/src/commands/key.rs index a544735..94607ab 100644 --- a/src/commands/key.rs +++ b/src/commands/key.rs @@ -79,10 +79,11 @@ impl AddCmd { let key = repo.key; let pass = self.new_password_file.as_ref().map_or_else( - || match Password::new().with_prompt("enter password for new key") - .allow_empty_password(true) - .with_confirmation("confirm password", "passwords do not match") - .interact() + || match Password::new() + .with_prompt("enter password for new key") + .allow_empty_password(true) + .with_confirmation("confirm password", "passwords do not match") + .interact() { Ok(it) => it, Err(err) => {