Skip to content

Commit f5ce230

Browse files
author
WinterPancake
committed
Ran rustfmt
1 parent 1054fbb commit f5ce230

File tree

6 files changed

+27
-22
lines changed

6 files changed

+27
-22
lines changed

cursive/src/helpers.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ use cursive::{
2424
};
2525
use lazy_static::lazy_static;
2626
use pass::Result;
27-
use ripasso::pass::Recipient;
28-
use ripasso::{crypto::CryptoImpl, pass};
27+
use ripasso::{crypto::CryptoImpl, pass, pass::Recipient};
2928

3029
lazy_static! {
3130
static ref CLIPBOARD: Arc<Mutex<Clipboard>> = Arc::new(Mutex::new(Clipboard::new().unwrap()));

cursive/src/main.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -734,24 +734,24 @@ fn create(ui: &mut Cursive, store: PasswordStoreType) {
734734
.with_name("password_length")
735735
.fixed_width(5);
736736

737-
let reveal_checkbox = LinearLayout::horizontal().child(
738-
cursive::views::Checkbox::new().on_change({
737+
let reveal_checkbox = LinearLayout::horizontal()
738+
.child(cursive::views::Checkbox::new().on_change({
739739
let reveal_flag = reveal_flag.clone();
740740
move |siv, checked| {
741741
siv.call_on_name("new_password_input", |e: &mut EditView| {
742742
e.set_secret(!checked);
743743
});
744744
*reveal_flag.lock().unwrap() = checked;
745745
}
746-
}),
747-
).child(TextView::new("Reveal password"));
746+
}))
747+
.child(TextView::new("Reveal password"));
748748

749749
let dialog_content = LinearLayout::vertical()
750750
.child(select.scrollable().fixed_size((30, 5)))
751751
.child(
752752
LinearLayout::horizontal()
753753
.child(TextView::new("Length: "))
754-
.child(length_input)
754+
.child(length_input),
755755
)
756756
.child(reveal_checkbox);
757757

@@ -792,16 +792,16 @@ fn create(ui: &mut Cursive, store: PasswordStoreType) {
792792
move |s| {
793793
let category = *category_value.lock().unwrap();
794794
let length = *password_length.lock().unwrap();
795-
let new_password = ripasso::password_generator::password_generator(length, category);
795+
let new_password =
796+
ripasso::password_generator::password_generator(length, category);
796797

797798
s.call_on_name("new_password_input", |e: &mut EditView| {
798799
e.set_content(new_password);
799800
});
800801
}
801802
})
802803
.button(CATALOG.gettext("Generate Passphrase"), move |s| {
803-
let new_password = match ripasso::passphrase_generator::passphrase_generator(6)
804-
{
804+
let new_password = match ripasso::passphrase_generator::passphrase_generator(6) {
805805
Ok(words) => words.join(" "),
806806
Err(err) => {
807807
helpers::errorbox(s, &ripasso::pass::Error::from(err));
@@ -830,7 +830,6 @@ fn create(ui: &mut Cursive, store: PasswordStoreType) {
830830
ui.add_layer(ev);
831831
}
832832

833-
834833
fn delete_recipient(ui: &mut Cursive, store: PasswordStoreType) -> Result<()> {
835834
let mut l = ui
836835
.find_name::<SelectView<Option<(PathBuf, Recipient)>>>("recipients")

cursive/src/tests/helpers.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
use std::sync::Arc;
22

3-
use crate::helpers::{
4-
get_value_from_input, is_checkbox_checked, is_radio_button_selected, recipients_widths,
5-
};
63
use cursive::{
74
view::Nameable,
85
views::{Checkbox, EditView, LinearLayout, RadioButton, RadioGroup},
96
};
107
use hex::FromHex;
11-
use ripasso::crypto::CryptoImpl;
12-
use ripasso::pass::{Comment, KeyRingStatus, OwnerTrustLevel, Recipient};
8+
use ripasso::{
9+
crypto::CryptoImpl,
10+
pass::{Comment, KeyRingStatus, OwnerTrustLevel, Recipient},
11+
};
12+
13+
use crate::helpers::{
14+
get_value_from_input, is_checkbox_checked, is_radio_button_selected, recipients_widths,
15+
};
1316

1417
#[test]
1518
fn test_get_value_from_input() {

src/passphrase_generator.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
use std::{
2+
fs::File,
3+
io::{self, BufRead},
4+
};
5+
16
use rand::seq::SliceRandom;
2-
use std::fs::File;
3-
use std::io::{self, BufRead};
47

58
pub fn passphrase_generator(wordcount: i32) -> io::Result<Vec<String>> {
69
let filename = "share/wordlists/eff_large.wordlist";

src/tests/pass.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use std::{env, fs::File, path::PathBuf};
2+
13
use config::ConfigBuilder;
24
use git2::Repository;
35
use hex::FromHex;
@@ -8,7 +10,6 @@ use sequoia_openpgp::{
810
stream::{Armorer, Message, Signer},
911
},
1012
};
11-
use std::{env, fs::File, path::PathBuf};
1213
use tempfile::tempdir;
1314

1415
use super::*;

src/tests/test_helpers.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ use std::{
77

88
use flate2::read::GzDecoder;
99
use hex::FromHex;
10-
use sequoia_openpgp::crypto::SessionKey;
11-
use sequoia_openpgp::packet::UserID;
12-
use sequoia_openpgp::types::SymmetricAlgorithm;
1310
use sequoia_openpgp::{
1411
Cert, KeyHandle, KeyID,
1512
cert::CertBuilder,
13+
crypto::SessionKey,
14+
packet::UserID,
1615
parse::{
1716
Parse,
1817
stream::{DecryptionHelper, DecryptorBuilder, MessageStructure, VerificationHelper},
1918
},
2019
policy::StandardPolicy,
20+
types::SymmetricAlgorithm,
2121
};
2222
use tar::Archive;
2323

0 commit comments

Comments
 (0)