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:
Questionnaire
Problem
The
forloop syntax inhtml!requireschildren.iter()to compile, but does not accept&children, which is the idiomatic Rust form and what clippy'sexplicit_iter_looplint likes.Minimal Reproduction
This compiles:
This does not:
Expected behavior
both should compile
Environment:
0.23.0]Questionnaire