Skip to content

Commit

Permalink
Don't run clippy on bindgen files. Added all the lints for build.rs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Grinkers committed Aug 20, 2024
1 parent fb38da5 commit e76d06d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ exclude = [
"vendor/linux/**/libusb",
]

[lints.rust]
rust_2018_idioms = { level = "warn", priority = -1 }
future-incompatible = "warn"

[lints.clippy]
nursery = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }

[dependencies]
cfg-if = "^1.0.0"

Expand Down
9 changes: 4 additions & 5 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ fn header_path() -> PathBuf {
"x86" => path.push("x86"),
"arm" | "aarch64" => match env::var("TARGET").unwrap().as_str() {
"arm-unknown-linux-musleabihf" | "arm-unknown-linux-gnueabihf" => {
path.push("armv6-hf")
path.push("armv6-hf");
}
"armv7-unknown-linux-musleabihf" | "armv7-unknown-linux-gnueabihf" => {
path.push("armv7-hf")
path.push("armv7-hf");
}
"aarch64-unknown-linux-musl" | "aarch64-unknown-linux-gnu" => {
path.push("armv8-hf")
path.push("armv8-hf");
}
target => panic!("Target not supported: {target}"),
},
Expand Down Expand Up @@ -131,8 +131,7 @@ fn linker_options() {
println!("cargo:rustc-link-lib=static=ftd2xx");

match env::var("CARGO_CFG_TARGET_OS").unwrap().as_str() {
"windows" => {}
"linux" => {}
"windows" | "linux" => {}
"macos" => {
println!("cargo:rustc-link-lib=framework=IOKit");
println!("cargo:rustc-link-lib=framework=CoreFoundation");
Expand Down
14 changes: 8 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
//! Rust FFI bindings to the [FTDI D2XX drivers](https://www.ftdichip.com/Drivers/D2XX.htm).
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(clippy::too_many_arguments)]
#![allow(clippy::upper_case_acronyms)]
#![allow(clippy::useless_transmute)]
#![allow(
future_incompatible,
non_camel_case_types,
non_snake_case,
non_upper_case_globals,
unsafe_code
)]
#![allow(clippy::all, clippy::pedantic, clippy::nursery)]

cfg_if::cfg_if! {
if #[cfg(feature = "bindgen")] {
Expand Down

0 comments on commit e76d06d

Please sign in to comment.