From 6e08703c6c18f5d82cda66825ee76a78900244df Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Thu, 4 Jan 2024 17:21:38 -0800 Subject: [PATCH] Fix compile issue --- packages/desktop/src/app.rs | 12 +++++++----- packages/desktop/src/desktop_context.rs | 6 +++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/desktop/src/app.rs b/packages/desktop/src/app.rs index 85e4eecbd..fac223ab0 100644 --- a/packages/desktop/src/app.rs +++ b/packages/desktop/src/app.rs @@ -334,12 +334,14 @@ impl App

{ let mut cx = std::task::Context::from_waker(&view.waker); loop { - let fut = view.dom.wait_for_work(); - pin_mut!(fut); + { + let fut = view.dom.wait_for_work(); + pin_mut!(fut); - match fut.poll_unpin(&mut cx) { - std::task::Poll::Ready(_) => {} - std::task::Poll::Pending => break, + match fut.poll_unpin(&mut cx) { + std::task::Poll::Ready(_) => {} + std::task::Poll::Pending => break, + } } send_edits(view.dom.render_immediate(), &view.desktop_context); diff --git a/packages/desktop/src/desktop_context.rs b/packages/desktop/src/desktop_context.rs index af1204b06..866056558 100644 --- a/packages/desktop/src/desktop_context.rs +++ b/packages/desktop/src/desktop_context.rs @@ -34,6 +34,9 @@ pub fn window() -> DesktopContext { dioxus_core::prelude::consume_context().unwrap() } +/// A handle to the [`DesktopService`] that can be passed around. +pub type DesktopContext = Rc; + /// An imperative interface to the current window. /// /// To get a handle to the current window, use the [`use_window`] hook. @@ -78,9 +81,6 @@ pub struct DesktopService { pub(crate) views: Rc>>, } -/// A handle to the [`DesktopService`] that can be passed around. -pub type DesktopContext = Rc; - /// A smart pointer to the current window. impl std::ops::Deref for DesktopService { type Target = Window;