From 07647daeb55570bdb93ffe5454401e422321c624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matou=C5=A1=20Volf?= Date: Fri, 6 Sep 2024 07:39:12 +0200 Subject: [PATCH] docs: add explaining comments --- src/components/bottom_panel.rs | 2 ++ src/route/mod.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/components/bottom_panel.rs b/src/components/bottom_panel.rs index 2b78b51..c90d542 100644 --- a/src/components/bottom_panel.rs +++ b/src/components/bottom_panel.rs @@ -6,6 +6,7 @@ use crate::route::Route; #[component] pub(crate) fn BottomPanel(display_form: Signal) -> Element { + // A signal for delaying the application of styles. #[allow(clippy::redundant_closure)] let mut expanded = use_signal(|| display_form()); let navigation_expanded = use_signal(|| false); @@ -16,6 +17,7 @@ pub(crate) fn BottomPanel(display_form: Signal) -> Element { expanded.set(true); } else { spawn(async move { + // Necessary for a smooth – not instant – height transition. async_std::task::sleep(std::time::Duration::from_millis(500)).await; expanded.set(false); }); diff --git a/src/route/mod.rs b/src/route/mod.rs index 6bb83d2..e0eb5c3 100644 --- a/src/route/mod.rs +++ b/src/route/mod.rs @@ -12,6 +12,8 @@ use crate::components::pages::not_found_page::NotFoundPage; use crate::components::layout::Layout; use dioxus::prelude::*; +// All variants have the same postfix because they have to match the component names. +#[allow(clippy::enum_variant_names)] #[derive(Clone, Routable, Debug, PartialEq)] #[rustfmt::skip] pub(crate) enum Route {