Apply clippy lint

This commit is contained in:
oupson 2022-10-08 21:01:39 +02:00
parent 2032d861dd
commit 0499bd782b
Signed by: oupson
GPG Key ID: 3BD88615552EFCB7
1 changed files with 7 additions and 9 deletions

View File

@ -35,7 +35,7 @@ fn ls(c: &LsCommand) -> anyhow::Result<()> {
let fs = GocryptFs::open(
c.gocryptfs_path
.as_ref()
.map(|p| Path::new(p))
.map(Path::new)
.unwrap_or(folder_path),
&password,
)?;
@ -59,15 +59,13 @@ fn ls(c: &LsCommand) -> anyhow::Result<()> {
println!("{}", res);
}
}
} else {
if let Ok(res) = dir_decoder.decode_filename(filename) {
} else if let Ok(res) = dir_decoder.decode_filename(filename) {
println!("{}", res);
}
};
}
}
return Ok(());
Ok(())
}
fn decrypt_file(c: &DecryptCommand) -> anyhow::Result<()> {
@ -82,7 +80,7 @@ fn decrypt_file(c: &DecryptCommand) -> anyhow::Result<()> {
let fs = GocryptFs::open(
c.gocryptfs_path
.as_ref()
.map(|p| Path::new(p))
.map(Path::new)
.unwrap_or_else(|| file_path.parent().unwrap()),
&password,
)?;
@ -106,7 +104,7 @@ fn decrypt_file(c: &DecryptCommand) -> anyhow::Result<()> {
stdout.write_all(&res)?;
if res.len() == 0 {
if res.is_empty() {
break;
}