diff --git a/tests/diff/src/lib.rs b/tests/diff/src/lib.rs index 92d81aa..137e119 100644 --- a/tests/diff/src/lib.rs +++ b/tests/diff/src/lib.rs @@ -182,10 +182,10 @@ enum Guard { impl Drop for Target { fn drop(&mut self) { - if let Guard::Edge(stop) = &mut self._guard { - if let Some(s) = stop.take() { - let _ = s.send(()); - } + if let Guard::Edge(stop) = &mut self._guard + && let Some(s) = stop.take() + { + let _ = s.send(()); } } } @@ -693,10 +693,10 @@ pub fn break_caddy(json: &str) -> String { fn walk(v: &mut serde_json::Value) { match v { serde_json::Value::Object(m) => { - if m.get("handler").and_then(|h| h.as_str()) == Some("reverse_proxy") { - if let Some(h) = m.get_mut("headers").and_then(|h| h.as_object_mut()) { - h.remove("response"); - } + if m.get("handler").and_then(|h| h.as_str()) == Some("reverse_proxy") + && let Some(h) = m.get_mut("headers").and_then(|h| h.as_object_mut()) + { + h.remove("response"); } m.values_mut().for_each(walk); } diff --git a/tests/support/src/proc.rs b/tests/support/src/proc.rs index 8e8eb6a..59e177b 100644 --- a/tests/support/src/proc.rs +++ b/tests/support/src/proc.rs @@ -97,7 +97,10 @@ pub fn require_binary(name: &str) -> Option { None } None => { - let var = format!("IANITOR_{}_BIN", name.to_ascii_uppercase().replace('-', "_")); + let var = format!( + "IANITOR_{}_BIN", + name.to_ascii_uppercase().replace('-', "_") + ); panic!( "`{name}` is needed for this test but was not found on PATH (or ${var}). \ In WSL: nix profile add nixpkgs#{name}. Set IANITOR_ALLOW_SKIP=1 to skip instead."