Merge pull request #1601 from gwenn/clippy

Fix clippy warnings
This commit is contained in:
gwenn 2024-11-23 11:37:14 +01:00 committed by GitHub
commit 0278f6ea19
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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