From 80f3a44ca7ce2e37cd90b0a35c04fcb9cd566052 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..2b179cf2d0c 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 _ = &#props_ident.#label; } }) .collect();