From d277bafd099151f7809bb73820a32f9e803967b4 Mon Sep 17 00:00:00 2001 From: tangaac Date: Wed, 26 Aug 2026 18:02:04 +0800 Subject: [PATCH] build.rs: replace manual Option::filter with .filter() Newer clippy flags `and_then(|x| if cond { None } else { Some(x) })` as `manual_filter`. Replace with `.filter(|x| !cond)` to satisfy `-D warnings`. --- build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.rs b/build.rs index 5d7969e1e..5bcd7ec8d 100644 --- a/build.rs +++ b/build.rs @@ -231,7 +231,7 @@ fn can_compile>(test: T) -> bool { // [here]: https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-reads let wrapper = var("RUSTC_WRAPPER") .ok() - .and_then(|w| if w.is_empty() { None } else { Some(w) }); + .filter(|w| !w.is_empty()); let mut cmd = if let Some(wrapper) = wrapper { let mut cmd = std::process::Command::new(wrapper);