From 5fefc9bfca80e3efcfb94adb48716f9ea27cf058 Mon Sep 17 00:00:00 2001 From: Stephan Boyer Date: Fri, 17 Nov 2023 06:03:08 -0800 Subject: [PATCH] Update the way lints are configured to use Rust's new `manifest-lint` feature --- Cargo.toml | 5 +++++ benchmarks/rust/Cargo.toml | 5 +++++ benchmarks/rust/build.rs | 4 ++-- benchmarks/rust/src/main.rs | 2 -- examples/rust/Cargo.toml | 5 +++++ examples/rust/build.rs | 4 ++-- examples/rust/src/main.rs | 2 -- integration_tests/rust/Cargo.toml | 5 +++++ integration_tests/rust/build.rs | 4 ++-- integration_tests/rust/src/main.rs | 2 -- src/main.rs | 2 -- 11 files changed, 26 insertions(+), 14 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8b178c5f..17773ef6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,11 @@ homepage = "https://github.com/stepchowfun/typical" repository = "https://github.com/stepchowfun/typical" readme = "README.md" +[lints] +clippy.all = "deny" +clippy.pedantic = "deny" +rust.warnings = "deny" + [dependencies] colored = "1" pad = "0.1" diff --git a/benchmarks/rust/Cargo.toml b/benchmarks/rust/Cargo.toml index 57bde43d..74e09f1c 100644 --- a/benchmarks/rust/Cargo.toml +++ b/benchmarks/rust/Cargo.toml @@ -4,4 +4,9 @@ version = "0.1.0" authors = ["Stephan Boyer "] edition = "2018" +[lints] +clippy.all = "deny" +clippy.pedantic = "deny" +rust.warnings = "deny" + [dependencies] diff --git a/benchmarks/rust/build.rs b/benchmarks/rust/build.rs index 2a44245f..9c616502 100644 --- a/benchmarks/rust/build.rs +++ b/benchmarks/rust/build.rs @@ -23,9 +23,9 @@ fn main() { assert!(output.status.success()); - for line in output.stdout.lines().map(|line| line.unwrap()) { + for line in output.stdout.lines().map(Result::unwrap) { if !line.is_empty() { - println!("cargo:rerun-if-changed={}", line); + println!("cargo:rerun-if-changed={line}"); } } } diff --git a/benchmarks/rust/src/main.rs b/benchmarks/rust/src/main.rs index bda0427f..952451a5 100644 --- a/benchmarks/rust/src/main.rs +++ b/benchmarks/rust/src/main.rs @@ -1,5 +1,3 @@ -#![deny(clippy::all, clippy::pedantic, warnings)] - mod types; use { diff --git a/examples/rust/Cargo.toml b/examples/rust/Cargo.toml index 26872e7b..c21ed85f 100644 --- a/examples/rust/Cargo.toml +++ b/examples/rust/Cargo.toml @@ -4,4 +4,9 @@ version = "0.1.0" authors = ["Stephan Boyer "] edition = "2018" +[lints] +clippy.all = "deny" +clippy.pedantic = "deny" +rust.warnings = "deny" + [dependencies] diff --git a/examples/rust/build.rs b/examples/rust/build.rs index 79fca91a..df7e6fbf 100644 --- a/examples/rust/build.rs +++ b/examples/rust/build.rs @@ -23,9 +23,9 @@ fn main() { assert!(output.status.success()); - for line in output.stdout.lines().map(|line| line.unwrap()) { + for line in output.stdout.lines().map(Result::unwrap) { if !line.is_empty() { - println!("cargo:rerun-if-changed={}", line); + println!("cargo:rerun-if-changed={line}"); } } } diff --git a/examples/rust/src/main.rs b/examples/rust/src/main.rs index e510ba39..a3658cae 100644 --- a/examples/rust/src/main.rs +++ b/examples/rust/src/main.rs @@ -1,5 +1,3 @@ -#![deny(clippy::all, clippy::pedantic, warnings)] - mod types; use { diff --git a/integration_tests/rust/Cargo.toml b/integration_tests/rust/Cargo.toml index bcb05423..71257548 100644 --- a/integration_tests/rust/Cargo.toml +++ b/integration_tests/rust/Cargo.toml @@ -4,4 +4,9 @@ version = "0.1.0" authors = ["Stephan Boyer "] edition = "2018" +[lints] +clippy.all = "deny" +clippy.pedantic = "deny" +rust.warnings = "deny" + [dependencies] diff --git a/integration_tests/rust/build.rs b/integration_tests/rust/build.rs index edbc59ab..20fa340f 100644 --- a/integration_tests/rust/build.rs +++ b/integration_tests/rust/build.rs @@ -23,9 +23,9 @@ fn main() { assert!(output.status.success()); - for line in output.stdout.lines().map(|line| line.unwrap()) { + for line in output.stdout.lines().map(Result::unwrap) { if !line.is_empty() { - println!("cargo:rerun-if-changed={}", line); + println!("cargo:rerun-if-changed={line}"); } } } diff --git a/integration_tests/rust/src/main.rs b/integration_tests/rust/src/main.rs index 73022458..fc113d9c 100644 --- a/integration_tests/rust/src/main.rs +++ b/integration_tests/rust/src/main.rs @@ -1,5 +1,3 @@ -#![deny(clippy::all, clippy::pedantic, warnings)] - mod assertions; mod circular_dependency; mod comprehensive; diff --git a/src/main.rs b/src/main.rs index 78bcb16f..e2f1bc3c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,3 @@ -#![deny(clippy::all, clippy::pedantic, warnings)] - mod assertions; mod count; mod error;