diff options
author | Cody P Schafer <dev@codyps.com> | 2021-08-04 17:05:18 -0400 |
---|---|---|
committer | Cody P Schafer <dev@codyps.com> | 2021-08-04 17:05:18 -0400 |
commit | cdef698ecc4de39a8b8572c84e94a5e12e3b5a9e (patch) | |
tree | 3b279c9ab2e58442614165b2d1536e6170ca320a | |
parent | 5f3f71fdd3e9318c0bf2bdda857815dbb99187ec (diff) | |
download | rust-libzfs-cdef698ecc4de39a8b8572c84e94a5e12e3b5a9e.zip |
zfs-core-sys/build: clippy
-rw-r--r-- | zfs-core-sys/build.rs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/zfs-core-sys/build.rs b/zfs-core-sys/build.rs index 97b4de7..479fbf8 100644 --- a/zfs-core-sys/build.rs +++ b/zfs-core-sys/build.rs @@ -1,6 +1,6 @@ use std::{ ffi::OsStr, - path::{Path, PathBuf}, + path::PathBuf, str::FromStr, }; @@ -56,7 +56,7 @@ fn main() { let mut build_env = build_env::BuildEnv::from_env().expect("Could not determine build_env"); let lzc_libdir = build_env.var("LIBZFS_CORE_LIBDIR"); - let lzc_lookup = if let Some(_) = lzc_libdir.as_ref() { + let lzc_lookup = if lzc_libdir.as_ref().is_some() { // Implies users want `LIBZFS_CORE_LOOKUP_WITH=link` Lookup::Link } else { @@ -105,16 +105,18 @@ fn main() { } } + // FIXME: we don't provide a way to specify the search path for nvpair. One can add search + // paths with RUSTFLAGS or some cargo.toml build target hacking. Consider if we should either + // rely on that mechanism entirely (even for libzfs_core), or add a LIB_DIR env var for + // nvpair/zutil/etc + // // there is currently no nvpair pkg-config, so unconditionally link if target_os == "macos" { // TODO: this is an openzfs on osx specific path. Provide a way to disable println!("cargo:rustc-link-search=native=/usr/local/zfs/lib"); } println!("cargo:rustc-link-lib=nvpair"); - match target_os.as_str() { - "freebsd" => { - println!("cargo:rustc-link-lib=dylib:-as-needed=zutil"); - } - _ => {} + if target_os == "freebsd" { + println!("cargo:rustc-link-lib=dylib:-as-needed=zutil"); } } |