From 39bb28130dc54ba294b5e6f9af441ba7692d6221 Mon Sep 17 00:00:00 2001 From: David Pedersen Date: Fri, 14 Apr 2023 22:26:56 +0200 Subject: [PATCH] Enable `println` warning (#1929) --- .github/workflows/CI.yml | 2 +- axum-core/src/lib.rs | 1 + axum-extra/src/lib.rs | 1 + axum-macros/src/lib.rs | 1 + axum/src/lib.rs | 2 +- examples/websockets/src/client.rs | 1 - 6 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a983ca86..6fe0e4e5 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -29,7 +29,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: clippy - args: --workspace --all-targets --all-features + args: --workspace --all-targets --all-features -- -D warnings - name: rustfmt uses: actions-rs/cargo@v1 with: diff --git a/axum-core/src/lib.rs b/axum-core/src/lib.rs index 974e5e18..94077c1f 100644 --- a/axum-core/src/lib.rs +++ b/axum-core/src/lib.rs @@ -48,6 +48,7 @@ #![allow(elided_lifetimes_in_paths, clippy::type_complexity)] #![forbid(unsafe_code)] #![cfg_attr(test, allow(clippy::float_cmp))] +#![cfg_attr(not(test), warn(clippy::print_stdout, clippy::dbg_macro))] #[macro_use] pub(crate) mod macros; diff --git a/axum-extra/src/lib.rs b/axum-extra/src/lib.rs index a7402f21..a964de37 100644 --- a/axum-extra/src/lib.rs +++ b/axum-extra/src/lib.rs @@ -64,6 +64,7 @@ #![forbid(unsafe_code)] #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] #![cfg_attr(test, allow(clippy::float_cmp))] +#![cfg_attr(not(test), warn(clippy::print_stdout, clippy::dbg_macro))] #[allow(unused_extern_crates)] extern crate self as axum_extra; diff --git a/axum-macros/src/lib.rs b/axum-macros/src/lib.rs index 584d8315..a49383e0 100644 --- a/axum-macros/src/lib.rs +++ b/axum-macros/src/lib.rs @@ -42,6 +42,7 @@ #![forbid(unsafe_code)] #![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(test, allow(clippy::float_cmp))] +#![cfg_attr(not(test), warn(clippy::print_stdout, clippy::dbg_macro))] use proc_macro::TokenStream; use quote::{quote, ToTokens}; diff --git a/axum/src/lib.rs b/axum/src/lib.rs index b10a8d6b..da60aef5 100644 --- a/axum/src/lib.rs +++ b/axum/src/lib.rs @@ -399,7 +399,6 @@ #![warn( clippy::all, - clippy::dbg_macro, clippy::todo, clippy::empty_enum, clippy::enum_glob_use, @@ -437,6 +436,7 @@ #![forbid(unsafe_code)] #![cfg_attr(docsrs, feature(doc_auto_cfg, doc_cfg))] #![cfg_attr(test, allow(clippy::float_cmp))] +#![cfg_attr(not(test), warn(clippy::print_stdout, clippy::dbg_macro))] #[macro_use] pub(crate) mod macros; diff --git a/examples/websockets/src/client.rs b/examples/websockets/src/client.rs index 2f61ad98..971b573e 100644 --- a/examples/websockets/src/client.rs +++ b/examples/websockets/src/client.rs @@ -30,7 +30,6 @@ async fn main() { let start_time = Instant::now(); //spawn several clients that will concurrently talk to the server let mut clients = (0..N_CLIENTS) - .into_iter() .map(|cli| tokio::spawn(spawn_client(cli))) .collect::>();