-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
Description
Problem
The for loop syntax in html! requires children.iter() to compile, but does not accept &children, which is the idiomatic Rust form and what clippy's explicit_iter_loop lint likes.
Minimal Reproduction
This compiles:
#[derive(Clone, PartialEq, Properties)]
pub struct WrapperProps {
pub children: Children,
}
#[component]
fn Wrapper(props: &WrapperProps) -> Html {
html! {
<ul>
for child in props.children.iter() {
<li>{child}</li>
}
</ul>
}
}This does not:
#[component]
fn Wrapper(props: &WrapperProps) -> Html {
html! {
<ul>
for child in &props.children {
<li>{child}</li>
}
</ul>
}
}Expected behavior
both should compile
Environment:
- Yew version: [
0.23.0]
Questionnaire
- I'm interested in fixing this myself but don't know where to start
- I would like to fix and I have a solution
- I don't have time to fix this right now, but maybe later
Reactions are currently unavailable