diff options
| author | murilo ijanc | 2026-03-25 15:10:15 -0300 |
|---|---|---|
| committer | murilo ijanc | 2026-03-25 15:10:15 -0300 |
| commit | 63c080840a7567f67effa9703d7c94b488d22fc1 (patch) | |
| tree | 9d9361fc02696a2904db974a0a0175c15bb363f9 /src/bin | |
| parent | 71a839341e34c7808cc90a6e5e25d269588e989c (diff) | |
| download | tesseras-paste-63c080840a7567f67effa9703d7c94b488d22fc1.tar.gz | |
Fix clippy warnings: needless borrow and collapsible if
Diffstat (limited to 'src/bin')
| -rw-r--r-- | src/bin/tpd.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/bin/tpd.rs b/src/bin/tpd.rs index c37afb6..54dbd7f 100644 --- a/src/bin/tpd.rs +++ b/src/bin/tpd.rs @@ -140,11 +140,11 @@ fn main() { eprintln!("error: cannot create {}: {e}", dir.display()); std::process::exit(1); } - if let Some(parent) = sock_path.parent() { - if let Err(e) = std::fs::create_dir_all(parent) { - eprintln!("error: cannot create {}: {e}", parent.display()); - std::process::exit(1); - } + if let Some(parent) = sock_path.parent() + && let Err(e) = std::fs::create_dir_all(parent) + { + eprintln!("error: cannot create {}: {e}", parent.display()); + std::process::exit(1); } let store = match PasteStore::open(&dir) { @@ -198,10 +198,10 @@ fn main() { // Apply unveil(2) to restrict filesystem visibility, // then pledge(2) to restrict syscalls. sandbox::do_unveil(&dir, "rwc"); - if sock_path.parent() != Some(dir.as_ref()) { - if let Some(parent) = sock_path.parent() { - sandbox::do_unveil(parent, "rwc"); - } + if sock_path.parent() != Some(dir.as_ref()) + && let Some(parent) = sock_path.parent() + { + sandbox::do_unveil(parent, "rwc"); } if !no_auto_bootstrap || !bootstrap.is_empty() { sandbox::do_unveil(std::path::Path::new("/etc/resolv.conf"), "r"); |