From b7a682fdd6aee0e9ef160fc23f8196f5f313dea6 Mon Sep 17 00:00:00 2001 From: Christopher Schramm Date: Mon, 7 Nov 2022 14:23:27 +0100 Subject: [PATCH] Avoid clippy::let-underscore-drop The following main.rs replicates the clippy warning: ``` use yew::prelude::*; struct Props { droppable: Vec<()>, } fn component(props: &Props) -> Html { let props = Props { droppable: Vec::new() }; html! { } } fn main() {} ``` If I'm not mistaken this happens when using the `..` on any `Properties` with a field that implements `Drop`. --- packages/yew-macro/src/props/component.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/yew-macro/src/props/component.rs b/packages/yew-macro/src/props/component.rs index d08dbeee809..68242b42ebe 100644 --- a/packages/yew-macro/src/props/component.rs +++ b/packages/yew-macro/src/props/component.rs @@ -64,7 +64,7 @@ impl ComponentProps { .iter() .map(|Prop { label, .. }| { quote_spanned! {Span::call_site().located_at(label.span())=> - let _ = #props_ident.#label; + let __yew_check_props = #props_ident.#label; } }) .collect();