From fc2aaa7df52a20426f08624ad4c29b2aaef4ae74 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Tue, 13 Dec 2022 15:54:59 -0800 Subject: [PATCH] fix: cargo check --- packages/core/tests/miri_simple.rs | 2 +- packages/tui/examples/tui_colorpicker.rs | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/core/tests/miri_simple.rs b/packages/core/tests/miri_simple.rs index 3504d4d4e..faf783603 100644 --- a/packages/core/tests/miri_simple.rs +++ b/packages/core/tests/miri_simple.rs @@ -63,7 +63,7 @@ fn contexts_drop() { } #[tokio::test] -fn tasks_drop() { +async fn tasks_drop() { fn app(cx: Scope) -> Element { cx.spawn(async { tokio::time::sleep(std::time::Duration::from_millis(100000)).await; diff --git a/packages/tui/examples/tui_colorpicker.rs b/packages/tui/examples/tui_colorpicker.rs index edbcbdddc..951c4d1e5 100644 --- a/packages/tui/examples/tui_colorpicker.rs +++ b/packages/tui/examples/tui_colorpicker.rs @@ -17,12 +17,14 @@ fn app(cx: Scope) -> Element { width: "100%", background_color: "hsl({hue}, 70%, {brightness}%)", onmousemove: move |evt| { - if let RenderReturn::Sync(Ok(node))=cx.root_node(){ - let node = tui_query.get(node.root_ids[0].get()); - let Size{width, height} = node.size().unwrap(); - let pos = evt.inner().element_coordinates(); - hue.set((pos.x as f32/width as f32)*255.0); - brightness.set((pos.y as f32/height as f32)*100.0); + if let RenderReturn::Sync(Ok(node)) = cx.root_node() { + if let Some(id) = node.root_ids[0].get() { + let node = tui_query.get(id); + let Size{width, height} = node.size().unwrap(); + let pos = evt.inner().element_coordinates(); + hue.set((pos.x as f32/width as f32)*255.0); + brightness.set((pos.y as f32/height as f32)*100.0); + } } }, "hsl({hue}, 70%, {brightness}%)",