Skip to content

Commit 195b843

Browse files
authored
feat: remove Clone requirement for slots in vectors (#1564)
1 parent 00ac66e commit 195b843

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

leptos_macro/src/view/client_builder.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,18 @@ pub(crate) fn fragment_to_tokens(
7474
let tokens = if lazy {
7575
quote! {
7676
{
77-
::leptos::Fragment::lazy(|| [
77+
::leptos::Fragment::lazy(|| ::std::vec![
7878
#(#nodes),*
79-
].to_vec())
79+
])
8080
#view_marker
8181
}
8282
}
8383
} else {
8484
quote! {
8585
{
86-
::leptos::Fragment::new([
86+
::leptos::Fragment::new(::std::vec![
8787
#(#nodes),*
88-
].to_vec())
88+
])
8989
#view_marker
9090
}
9191
}

leptos_macro/src/view/server_template.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ pub(crate) fn fragment_to_tokens_ssr(
8383
});
8484
quote! {
8585
{
86-
leptos::Fragment::lazy(|| [
86+
leptos::Fragment::lazy(|| ::std::vec![
8787
#(#nodes),*
88-
].to_vec())
88+
])
8989
#view_marker
9090
}
9191
}
@@ -597,15 +597,14 @@ fn set_style_attribute_ssr(
597597
let static_style_attr = node
598598
.attributes()
599599
.iter()
600-
.filter_map(|a| match a {
600+
.find_map(|a| match a {
601601
NodeAttribute::Attribute(attr)
602602
if attr.key.to_string() == "style" =>
603603
{
604604
attr.value().and_then(value_to_string)
605605
}
606606
_ => None,
607607
})
608-
.next()
609608
.map(|style| format!("{style};"));
610609

611610
let dyn_style_attr = node

leptos_macro/src/view/slot_helper.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@ pub(crate) fn slot_to_tokens(
143143
let slot = Ident::new(&slot, span);
144144
if values.len() > 1 {
145145
quote! {
146-
.#slot([
146+
.#slot(::std::vec![
147147
#(#values)*
148-
].to_vec())
148+
])
149149
}
150150
} else {
151151
let value = &values[0];

0 commit comments

Comments
 (0)