From 67c389a9ee390cdc1df22db886a1faa82f8557a9 Mon Sep 17 00:00:00 2001 From: Danik Vitek Date: Sun, 17 Sep 2023 12:00:19 +0300 Subject: [PATCH] Fix dereference --- leptos_dom/src/events.rs | 5 +---- leptos_dom/src/html.rs | 10 ++++++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/leptos_dom/src/events.rs b/leptos_dom/src/events.rs index f2f4f19529..2fd47a9f1f 100644 --- a/leptos_dom/src/events.rs +++ b/leptos_dom/src/events.rs @@ -69,10 +69,7 @@ pub fn add_event_listener( } let cb = Closure::wrap(cb as Box).into_js_value(); - let key = { - let key = key.borrow(); - intern(&key) - }; + let key = intern(&*key.borrow()); _ = js_sys::Reflect::set(target, &JsValue::from_str(&key), &cb); add_delegated_event_listener(&key, event_name, options); } diff --git a/leptos_dom/src/html.rs b/leptos_dom/src/html.rs index 63941d6474..0cadfae694 100644 --- a/leptos_dom/src/html.rs +++ b/leptos_dom/src/html.rs @@ -785,7 +785,10 @@ impl HtmlElement { ); let new_classes = classes.iter().flat_map(|classes| { - classes.borrow().split_whitespace() + classes + .borrow() + .split_whitespace() + .collect::>() }); if let Some(prev_classes) = prev_classes { @@ -793,7 +796,10 @@ impl HtmlElement { new_classes.collect::>(); let mut old_classes = prev_classes.iter().flat_map(|classes| { - classes.borrow().split_whitespace() + classes + .borrow() + .split_whitespace() + .collect::>() }); // Remove old classes