Make clippy happy

This commit is contained in:
Jonathan Kelley committed 2024-01-10 23:26:26 -08:00
1 parent 593527d58b
commit b8061d6d14
8 files changed
+20 -23

No files matched your search

+1 -1
View File
@@ -15,7 +15,7 @@ fn app(cx: Scope) -> Element {
if *running.current() {
loop {
tokio::time::sleep(std::time::Duration::from_millis(10)).await;
if let Some(element) = elements.read().get(focused) {
if let Some(element) = elements.with(|f| f.get(focused).cloned()) {
_ = element.set_focus(true).await;
} else {
focused = 0;
+4 -2
View File
@@ -22,8 +22,10 @@ fn app(cx: Scope) -> Element {
button {
onclick: move |_| {
if let Some(header) = header_element.read().as_ref() {
_ = header.scroll_to(ScrollBehavior::Smooth);
if let Some(header) = header_element.read().as_ref().cloned() {
cx.spawn(async move {
let _ = header.scroll_to(ScrollBehavior::Smooth).await;
});
}
},
"Scroll to top"