Skip to content

Commit

Permalink
Fixed clippy warnings in view macro output
Browse files Browse the repository at this point in the history
  • Loading branch information
Ar4ys committed Feb 10, 2024
1 parent 4abbe06 commit 120ba4b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
11 changes: 9 additions & 2 deletions leptos_macro/src/view/component_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
}
};

Expand Down
2 changes: 1 addition & 1 deletion leptos_macro/src/view/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
}
2 changes: 1 addition & 1 deletion leptos_macro/src/view/slot_helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ pub(crate) fn slot_to_tokens(
#children
#build;

#[allow(unreachable_code)]
#[allow(unreachable_code, clippy::useless_conversion)]
slot.into()
},
};
Expand Down

0 comments on commit 120ba4b

Please sign in to comment.