chore: tweak generic arguments and iterators in rsx

This commit is contained in:
Jonathan Kelley committed 2022-11-15 20:58:56 -08:00
1 parent e8ae830cf2
commit e09b6bf813
7 files changed
+93 -66

No files matched your search

+3 -2
View File
@@ -8,11 +8,12 @@ fn app(cx: Scope) -> Element {
cx.render(rsx!(
// Use Map directly to lazily pull elements
(0..10).map(|f| rsx! { "{f}" }),
// Collect into an intermediate collection if necessary
// Collect into an intermediate collection if necessary, and call into_iter
["a", "b", "c"]
.into_iter()
.map(|f| rsx! { "{f}" })
.collect::<Vec<_>>(),
.collect::<Vec<_>>()
.into_iter(),
// Use optionals
Some(rsx! { "Some" }),
))