From db53a4daa407bb86fdf55764b819af40ffbbb120 Mon Sep 17 00:00:00 2001 From: Fangdun Tsai Date: Sun, 17 Dec 2023 04:03:17 +0800 Subject: [PATCH] chore: remove unused_assignments from allow list --- Cargo.toml | 1 + viz-core/src/lib.rs | 5 +---- viz-handlers/src/lib.rs | 5 +---- viz-handlers/src/prometheus.rs | 2 +- viz-macros/src/lib.rs | 5 +---- viz-router/src/lib.rs | 16 ++++++++-------- viz-router/src/route.rs | 2 +- viz/src/lib.rs | 5 +---- 8 files changed, 15 insertions(+), 26 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3fb9505f..0fa35541 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -126,6 +126,7 @@ missing_docs = "warn" [workspace.lints.clippy] all = "deny" pedantic = "deny" +needless_pass_by_value = "warn" module_name_repetitions = { level = "allow", priority = 1 } too_many_lines = { level = "allow", priority = 1 } type_complexity = { level = "allow", priority = 1 } diff --git a/viz-core/src/lib.rs b/viz-core/src/lib.rs index c308de5f..3c6798d0 100644 --- a/viz-core/src/lib.rs +++ b/viz-core/src/lib.rs @@ -6,10 +6,7 @@ #![doc(html_favicon_url = "https://viz.rs/logo.svg")] #![doc(test( no_crate_inject, - attr( - deny(warnings, rust_2018_idioms), - allow(dead_code, unused_assignments, unused_variables) - ) + attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables)) ))] #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] diff --git a/viz-handlers/src/lib.rs b/viz-handlers/src/lib.rs index eb8843d8..54c49b84 100644 --- a/viz-handlers/src/lib.rs +++ b/viz-handlers/src/lib.rs @@ -4,10 +4,7 @@ #![doc(html_favicon_url = "https://viz.rs/logo.svg")] #![doc(test( no_crate_inject, - attr( - deny(warnings, rust_2018_idioms), - allow(dead_code, unused_assignments, unused_variables) - ) + attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables)) ))] #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] diff --git a/viz-handlers/src/prometheus.rs b/viz-handlers/src/prometheus.rs index 484b9320..1326281c 100644 --- a/viz-handlers/src/prometheus.rs +++ b/viz-handlers/src/prometheus.rs @@ -24,7 +24,7 @@ pub struct Prometheus { } impl Prometheus { - /// Creates a new Prometheus. + /// Creates a new [`Prometheus`]. #[must_use] pub fn new(registry: Registry) -> Self { Self { registry } diff --git a/viz-macros/src/lib.rs b/viz-macros/src/lib.rs index c2283894..026101a9 100644 --- a/viz-macros/src/lib.rs +++ b/viz-macros/src/lib.rs @@ -29,10 +29,7 @@ #![doc(html_favicon_url = "https://viz.rs/logo.svg")] #![doc(test( no_crate_inject, - attr( - deny(warnings, rust_2018_idioms), - allow(dead_code, unused_assignments, unused_variables) - ) + attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables)) ))] #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] diff --git a/viz-router/src/lib.rs b/viz-router/src/lib.rs index f339ff62..d91622dd 100644 --- a/viz-router/src/lib.rs +++ b/viz-router/src/lib.rs @@ -4,10 +4,7 @@ #![doc(html_favicon_url = "https://viz.rs/logo.svg")] #![doc(test( no_crate_inject, - attr( - deny(warnings, rust_2018_idioms), - allow(dead_code, unused_assignments, unused_variables) - ) + attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables)) ))] #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] #![allow(clippy::needless_pass_by_value)] @@ -16,12 +13,15 @@ pub(crate) mod macros; mod resources; +pub use resources::Resources; + mod route; +pub use route::*; + mod router; +pub use router::Router; + mod tree; +pub use tree::Tree; pub use path_tree::{Path, PathTree}; -pub use resources::Resources; -pub use route::*; -pub use router::Router; -pub use tree::Tree; diff --git a/viz-router/src/route.rs b/viz-router/src/route.rs index de380b5d..c86334d7 100644 --- a/viz-router/src/route.rs +++ b/viz-router/src/route.rs @@ -167,7 +167,7 @@ impl FromIterator<(Method, BoxHandler)> for Route { pub fn on(method: Method, handler: H) -> Route where H: Handler> + Clone, - O: IntoResponse + Send + Sync + 'static, + O: IntoResponse + Send + 'static, { Route::new().on(method, handler) } diff --git a/viz/src/lib.rs b/viz/src/lib.rs index 5d277aa0..354cc9f7 100644 --- a/viz/src/lib.rs +++ b/viz/src/lib.rs @@ -517,10 +517,7 @@ #![doc(html_favicon_url = "https://viz.rs/logo.svg")] #![doc(test( no_crate_inject, - attr( - deny(warnings, rust_2018_idioms), - allow(dead_code, unused_assignments, unused_variables) - ) + attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables)) ))] #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]