mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
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:
parent
812c65c54c
commit
b649e9dacd
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user