From 127709f83f6614940459c89f699e9b2dc67cbba9 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Thu, 18 Jan 2024 10:59:43 -0800 Subject: [PATCH] Tiny aesthetic tweaks --- packages/core/src/scope_context.rs | 4 ++-- packages/desktop/src/app.rs | 2 +- packages/desktop/src/edits.rs | 15 +-------------- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/packages/core/src/scope_context.rs b/packages/core/src/scope_context.rs index 955258b6b..24498b00c 100644 --- a/packages/core/src/scope_context.rs +++ b/packages/core/src/scope_context.rs @@ -269,8 +269,8 @@ impl ScopeContext { .get(cur_hook) .and_then(|inn| { self.hook_index.set(cur_hook + 1); - let raw_ref: & dyn Any = inn.as_ref(); - raw_ref.downcast_ref ::().cloned() + let raw_ref: &dyn Any = inn.as_ref(); + raw_ref.downcast_ref::().cloned() }) .expect( r#" diff --git a/packages/desktop/src/app.rs b/packages/desktop/src/app.rs index 15f989e3b..9adf6bc96 100644 --- a/packages/desktop/src/app.rs +++ b/packages/desktop/src/app.rs @@ -50,7 +50,7 @@ pub(crate) struct App { /// A bundle of state shared between all the windows, providing a way for us to communicate with running webview. /// /// Todo: everything in this struct is wrapped in Rc<>, but we really only need the one top-level refcell -pub struct SharedContext { +pub(crate) struct SharedContext { pub(crate) event_handlers: WindowEventHandlers, pub(crate) pending_webviews: RefCell>, pub(crate) shortcut_manager: ShortcutRegistry, diff --git a/packages/desktop/src/edits.rs b/packages/desktop/src/edits.rs index 8e5f5ec16..258dc2e97 100644 --- a/packages/desktop/src/edits.rs +++ b/packages/desktop/src/edits.rs @@ -1,6 +1,4 @@ -use std::{cell::RefCell, rc::Rc, sync::Arc, sync::Mutex}; - -use std::fmt::{Debug, Formatter}; +use std::{cell::RefCell, rc::Rc}; /// This handles communication between the requests that the webview makes and the interpreter. The interpreter constantly makes long running requests to the webview to get any edits that should be made to the DOM almost like server side events. /// It will hold onto the requests until the interpreter is ready to handle them and hold onto any pending edits until a new request is made. @@ -10,17 +8,6 @@ pub(crate) struct EditQueue { responder: Rc>>, } -impl Debug for EditQueue { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - f.debug_struct("EditQueue") - .field("queue", &self.queue) - .field("responder", { - &self.responder.borrow().as_ref().map(|_| ()) - }) - .finish() - } -} - impl EditQueue { pub fn handle_request(&self, responder: wry::RequestAsyncResponder) { let mut queue = self.queue.borrow_mut();