diff --git a/src/commands/ls.rs b/src/commands/ls.rs index 3fad98f..462436e 100644 --- a/src/commands/ls.rs +++ b/src/commands/ls.rs @@ -24,7 +24,7 @@ pub(super) fn execute(be: &impl ReadBackend, opts: Opts) -> Result<()> { } })?; - let index= BoomIndex::from_iter(AllIndexFiles::new(be.clone()).into_iter()); + let index = BoomIndex::from_iter(AllIndexFiles::new(be.clone()).into_iter()); let snap = SnapshotFile::from_backend(be, id)?; for path_node in TreeIterator::from_id(be.clone(), index, snap.tree) { diff --git a/src/commands/mod.rs b/src/commands/mod.rs index 8afa259..91a53f5 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -45,7 +45,7 @@ pub fn execute() -> Result<()> { let args = Opts::parse(); let be = LocalBackend::new(&args.repository); - let passwd = fs::read_to_string(&args.password_file)?.replace("\n",""); + let passwd = fs::read_to_string(&args.password_file)?.replace("\n", ""); let key = repo::find_key_in_backend(&be, &passwd, None)?; let dbe = DecryptBackend::new(&be, key); diff --git a/src/repo/key.rs b/src/repo/key.rs index cc1516a..1229a6b 100644 --- a/src/repo/key.rs +++ b/src/repo/key.rs @@ -28,8 +28,7 @@ impl KeyFile { let salt = base64::decode(&self.salt)?; let mut key = [0; 64]; - scrypt::scrypt(passwd.as_ref(), &salt, ¶ms, &mut key) - .expect("output length invalid?"); + scrypt::scrypt(passwd.as_ref(), &salt, ¶ms, &mut key).expect("output length invalid?"); Ok(Key::from_slice(&key)) } @@ -93,7 +92,11 @@ impl MasterKey { /// Find a KeyFile in the backend that fits to the given password and return the contained key /// If a key hint is given, only this key is tested (recommended for a large number of keys) -pub fn find_key_in_backend(be: &B, passwd: &impl AsRef<[u8]>, hint: Option) -> Result { +pub fn find_key_in_backend( + be: &B, + passwd: &impl AsRef<[u8]>, + hint: Option, +) -> Result { match hint { Some(id) => KeyFile::from_backend(be, id)?.key_from_password(passwd), None => be