From 120ba4ba5c4f26c9e8df7a988ac465c6e40b76b3 Mon Sep 17 00:00:00 2001 From: Ar4ys Date: Sat, 10 Feb 2024 20:08:59 +0100 Subject: [PATCH] Fixed clippy warnings in view macro output --- leptos_macro/src/view/component_builder.rs | 11 +++++++++-- leptos_macro/src/view/mod.rs | 2 +- leptos_macro/src/view/slot_helper.rs | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/leptos_macro/src/view/component_builder.rs b/leptos_macro/src/view/component_builder.rs index 6ac34c5482..b7c5f99359 100644 --- a/leptos_macro/src/view/component_builder.rs +++ b/leptos_macro/src/view/component_builder.rs @@ -217,12 +217,19 @@ pub(crate) fn component_to_tokens( let props = #component_props_builder #(#props)* #(#slots)* - #children + #children; + + #[allow(clippy::let_unit_value, clippy::unit_arg)] + let props = props #build #dyn_attrs; #[allow(unreachable_code)] - ::leptos::component_view(#name_ref, props) + ::leptos::component_view( + #[allow(clippy::needless_borrows_for_generic_args)] + #name_ref, + props + ) } }; diff --git a/leptos_macro/src/view/mod.rs b/leptos_macro/src/view/mod.rs index b755d679f7..e5aab2f654 100644 --- a/leptos_macro/src/view/mod.rs +++ b/leptos_macro/src/view/mod.rs @@ -540,5 +540,5 @@ pub(crate) fn directive_call_from_attribute_node( quote_spanned!(attr.key.span()=> ().into()) }; - quote! { .directive(#handler, #param) } + quote! { .directive(#handler, #[allow(clippy::useless_conversion)] #param) } } diff --git a/leptos_macro/src/view/slot_helper.rs b/leptos_macro/src/view/slot_helper.rs index ad8ab8b0d4..5d41c7de7f 100644 --- a/leptos_macro/src/view/slot_helper.rs +++ b/leptos_macro/src/view/slot_helper.rs @@ -175,7 +175,7 @@ pub(crate) fn slot_to_tokens( #children #build; - #[allow(unreachable_code)] + #[allow(unreachable_code, clippy::useless_conversion)] slot.into() }, };