Skip to content

Commit

Permalink
chore: clippy 1.78
Browse files Browse the repository at this point in the history
  • Loading branch information
banditopazzo authored and vadorovsky committed May 3, 2024
1 parent 9b8c513 commit 99ad35c
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions crates/bpf-filtering/src/process_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,17 @@ fn get_process_namespace(pid: Pid, ns_type: &str) -> Result<u32, Error> {
}

fn get_process_namespace_or_log(pid: Pid, namespace_type: &str) -> u32 {
get_process_namespace(pid, namespace_type).map_or_else(
|e| {
if pid.as_raw() != 0 {
log::warn!(
"Failed to determine {} namespace for process {:?}: {}",
namespace_type,
pid,
e
);
}
u32::default()
},
|v| v,
)
get_process_namespace(pid, namespace_type).unwrap_or_else(|e| {
if pid.as_raw() != 0 {
log::warn!(
"Failed to determine {} namespace for process {:?}: {}",
namespace_type,
pid,
e
);
}
u32::default()
})
}

fn get_process_namespaces(pid: Pid) -> Namespaces {
Expand Down

0 comments on commit 99ad35c

Please sign in to comment.