Skip to content

Commit

Permalink
Avoid clippy::let-underscore-drop
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
cschramm committed Nov 7, 2022
1 parent 812c65c commit 80f3a44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/yew-macro/src/props/component.rs
Expand Up @@ -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();
Expand Down

0 comments on commit 80f3a44

Please sign in to comment.