clippy fixes

This commit is contained in:
Robin Appelman 2025-11-14 19:24:08 +01:00
commit c3818d3b74

View file

@ -90,11 +90,11 @@ impl Drop for ActiveProxy {
}
// we do this here, since the proxy process won't have permissions for it anymore
if let ForwardSource::Unix(path) = &source {
if let Err(error) = remove_file(path) {
if let ForwardSource::Unix(path) = &source
&& let Err(error) = remove_file(path)
{
error!(%error, "failed to remove unix socket");
}
}
});
}
}
@ -155,12 +155,12 @@ pub fn proxy(
};
rt.block_on(async {
if let Some(listen_namespace) = listen_namespace {
if let Err(error) = setns(listen_namespace, CloneFlags::CLONE_NEWNET) {
if let Some(listen_namespace) = listen_namespace
&& let Err(error) = setns(listen_namespace, CloneFlags::CLONE_NEWNET)
{
error!(%error, "Failed to join listen network namespace for proxy");
return Err(error.into());
}
}
let proxy = match Proxy::listen(&source) {
Ok(proxy) => proxy,