Forráskód Böngészése

chore: clean up clock

Jonathan Kelley 2 éve
szülő
commit
ba20bc08b8
2 módosított fájl, 3 hozzáadás és 6 törlés
  1. 3 4
      examples/clock.rs
  2. 0 2
      packages/core/src/scheduler/task.rs

+ 3 - 4
examples/clock.rs

@@ -3,16 +3,15 @@
 //! The example from the README.md.
 //! The example from the README.md.
 
 
 use dioxus::prelude::*;
 use dioxus::prelude::*;
-use futures_util::Future;
 
 
 fn main() {
 fn main() {
     dioxus_desktop::launch(app);
     dioxus_desktop::launch(app);
 }
 }
 
 
 fn app(cx: Scope) -> Element {
 fn app(cx: Scope) -> Element {
-    let mut count = use_ref(cx, || 0);
+    let count = use_ref(cx, || 0);
 
 
-    let mut ct = count.to_owned();
+    let ct = count.to_owned();
     use_coroutine(cx, |_: UnboundedReceiver<()>| async move {
     use_coroutine(cx, |_: UnboundedReceiver<()>| async move {
         loop {
         loop {
             tokio::time::sleep(std::time::Duration::from_millis(10)).await;
             tokio::time::sleep(std::time::Duration::from_millis(10)).await;
@@ -25,7 +24,7 @@ fn app(cx: Scope) -> Element {
         }
         }
     });
     });
 
 
-    let mut count = count.read();
+    let count = count.read();
 
 
     cx.render(rsx! {
     cx.render(rsx! {
         div { "High-Five counter: {count}" }
         div { "High-Five counter: {count}" }

+ 0 - 2
packages/core/src/scheduler/task.rs

@@ -72,8 +72,6 @@ pub struct LocalTaskHandle {
 
 
 impl ArcWake for LocalTaskHandle {
 impl ArcWake for LocalTaskHandle {
     fn wake_by_ref(arc_self: &Arc<Self>) {
     fn wake_by_ref(arc_self: &Arc<Self>) {
-        println!("waking task: {:?} {:p}", arc_self.id, arc_self);
-
         arc_self
         arc_self
             .tx
             .tx
             .unbounded_send(SchedulerMsg::TaskNotified(arc_self.id))
             .unbounded_send(SchedulerMsg::TaskNotified(arc_self.id))