From c20f9b044d32ae3bdf5914744a1b8543394f10a1 Mon Sep 17 00:00:00 2001 From: gwenn Date: Sat, 23 Nov 2024 11:25:17 +0100 Subject: [PATCH] Fix clippy warnings --- libsqlite3-sys/build.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libsqlite3-sys/build.rs b/libsqlite3-sys/build.rs index 7a3d17b..f96d656 100644 --- a/libsqlite3-sys/build.rs +++ b/libsqlite3-sys/build.rs @@ -15,7 +15,7 @@ fn win_target() -> bool { /// See [`win_target`] #[cfg(any(feature = "bundled", feature = "bundled-windows"))] fn android_target() -> bool { - env::var("CARGO_CFG_TARGET_OS").map_or(false, |v| v == "android") + env::var("CARGO_CFG_TARGET_OS").is_ok_and(|v| v == "android") } /// Tells whether a given compiler will be used `compiler_name` is compared to @@ -23,7 +23,7 @@ fn android_target() -> bool { /// /// See [`win_target`] fn is_compiler(compiler_name: &str) -> bool { - env::var("CARGO_CFG_TARGET_ENV").map_or(false, |v| v == compiler_name) + env::var("CARGO_CFG_TARGET_ENV").is_ok_and(|v| v == compiler_name) } /// Copy bindgen file from `dir` to `out_path`. @@ -47,7 +47,7 @@ fn main() { } println!("cargo:rerun-if-env-changed=LIBSQLITE3_SYS_USE_PKG_CONFIG"); - if env::var_os("LIBSQLITE3_SYS_USE_PKG_CONFIG").map_or(false, |s| s != "0") + if env::var_os("LIBSQLITE3_SYS_USE_PKG_CONFIG").is_some_and(|s| s != "0") || cfg!(feature = "loadable_extension") { build_linked::main(&out_dir, &out_path); @@ -239,7 +239,7 @@ mod build_bundled { if !win_target() { cfg.flag("-DHAVE_LOCALTIME_R"); } - if env::var("TARGET").map_or(false, |v| v.starts_with("wasm32-wasi")) { + if env::var("TARGET").is_ok_and(|v| v.starts_with("wasm32-wasi")) { cfg.flag("-USQLITE_THREADSAFE") .flag("-DSQLITE_THREADSAFE=0") // https://github.com/rust-lang/rust/issues/74393