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