From 0499bd782b883dd3fdab57be8c7668e64ebe189b Mon Sep 17 00:00:00 2001 From: oupson Date: Sat, 8 Oct 2022 21:01:39 +0200 Subject: [PATCH] Apply clippy lint --- rustcryptfs/src/main.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/rustcryptfs/src/main.rs b/rustcryptfs/src/main.rs index 979c5d3..bbad968 100644 --- a/rustcryptfs/src/main.rs +++ b/rustcryptfs/src/main.rs @@ -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) { - println!("{}", res); - } - }; + } 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; }