diff --git a/src/alert/mod.rs b/src/alert/mod.rs index 36b7320..7b5e6f1 100644 --- a/src/alert/mod.rs +++ b/src/alert/mod.rs @@ -55,15 +55,15 @@ pub fn Alert( let variant = variant.get(); css_vars.push_str(&format!( "--icon-color: {};", - variant.theme_icon_color(&theme) + variant.theme_icon_color(theme) )); css_vars.push_str(&format!( "--background-color: {};", - variant.theme_background_color(&theme) + variant.theme_background_color(theme) )); css_vars.push_str(&format!( "--border-color: {};", - variant.theme_border_color(&theme) + variant.theme_border_color(theme) )); }); diff --git a/src/auto_complete/mod.rs b/src/auto_complete/mod.rs index 79e782e..28ec2a2 100644 --- a/src/auto_complete/mod.rs +++ b/src/auto_complete/mod.rs @@ -58,7 +58,7 @@ pub fn AutoComplete(
) -> impl I class="melt-color-picker-popover" ref=popover_ref style=move || { - if !is_show_popover.get() { format!("display: none").into() } else { None } + if !is_show_popover.get() { Some("display: none") } else { None } } > @@ -143,7 +143,7 @@ fn ColorPanel(hue: ReadSignal, sv: RwSignal<(f64, f64)>) -> impl IntoView { let on_mouse_move = window_event_listener(ev::mousemove, cb); let on_mouse_up = window_event_listener(ev::mouseup, move |_| { mouse.update_value(|value| { - for handle in value.drain(..).into_iter() { + for handle in value.drain(..) { handle.remove(); } }); @@ -205,7 +205,7 @@ fn HueSlider(hue: RwSignal) -> impl IntoView { let on_mouse_move = window_event_listener(ev::mousemove, cb); let on_mouse_up = window_event_listener(ev::mouseup, move |_| { mouse.update_value(|value| { - for handle in value.drain(..).into_iter() { + for handle in value.drain(..) { handle.remove(); } }); diff --git a/src/mobile/toast/mod.rs b/src/mobile/toast/mod.rs index b5ef062..6a21c6f 100644 --- a/src/mobile/toast/mod.rs +++ b/src/mobile/toast/mod.rs @@ -15,7 +15,7 @@ pub fn show_toast(options: ToastOptions) { let children = view! {
{options.message}
}; let node = children.into_view(); - #[cfg(all(target_arch = "wasm32"))] + #[cfg(target_arch = "wasm32")] { use leptos::leptos_dom::Mountable; let node = node.get_mountable_node(); diff --git a/src/tabs/mod.rs b/src/tabs/mod.rs index 814cdfb..e4671b0 100644 --- a/src/tabs/mod.rs +++ b/src/tabs/mod.rs @@ -18,8 +18,8 @@ pub fn Tabs( mount_style("tabs", include_str!("./tabs.css")); let tab_options_vec = create_rw_signal(vec![]); provide_context(TabsInjectionKey { - active_key: value.deref().clone(), - tab_options_vec: tab_options_vec.clone(), + active_key: *value.deref(), + tab_options_vec, }); let theme = use_theme(Theme::light); let css_vars = create_memo(move |_| { diff --git a/src/teleport/mod.rs b/src/teleport/mod.rs index de986dd..8747075 100644 --- a/src/teleport/mod.rs +++ b/src/teleport/mod.rs @@ -13,7 +13,7 @@ pub fn Teleport(#[prop(optional)] to: Option<&'static str>, children: Children) Element::from(document().body().expect("body element not to exist")) }; - #[cfg(all(target_arch = "wasm32"))] + #[cfg(target_arch = "wasm32")] { use leptos::leptos_dom::Mountable; let node = children().into_view(); diff --git a/src/utils/maybe_rw_signal.rs b/src/utils/maybe_rw_signal.rs index 15a4bb6..22b043a 100644 --- a/src/utils/maybe_rw_signal.rs +++ b/src/utils/maybe_rw_signal.rs @@ -5,7 +5,7 @@ pub struct MaybeRwSignal(RwSignal); impl MaybeRwSignal { pub fn clone_into(&self) -> RwSignal { - self.0.clone() + self.0 } } diff --git a/src/utils/signal.rs b/src/utils/signal.rs index 80cbeec..a8936e9 100644 --- a/src/utils/signal.rs +++ b/src/utils/signal.rs @@ -29,7 +29,7 @@ impl SignalWatch for RwSignal { /// count.set(2); // nothing happens /// ``` fn watch(&self, f: impl Fn(&Self::Value) + 'static) -> Box { - let signal = self.clone(); + let signal = *self; let effect = create_effect(move |prev| { signal.with(|value| {