Skip to content

Commit

Permalink
fix rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
aawsome committed Jun 26, 2023
1 parent 4250bb2 commit bec4d7c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion crates/rustic_core/src/repository.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand All @@ -18,7 +19,6 @@ use nom::{
sequence::delimited,
IResult,
};
use dialoguer::Password;

use serde_with::{serde_as, DisplayFromStr};

Expand Down
9 changes: 5 additions & 4 deletions src/commands/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
9 changes: 5 additions & 4 deletions src/commands/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit bec4d7c

Please sign in to comment.