Avoid clippy::let-underscore-drop (#2952)

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! { <Component ..props /> }
}

fn main() {}
```

If I'm not mistaken this happens when using the `..` on any `Properties` with a field that implements `Drop`.
This commit is contained in:
Christopher Schramm 2022-11-08 17:21:06 +01:00 committed by GitHub
parent 812c65c54c
commit b649e9dacd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();