@@ -263,6 +263,9 @@ pub struct Context<T: UserEvent> {
263263 webview_runtime_installed : bool ,
264264}
265265
266+ unsafe impl < T : UserEvent > Send for Context < T > { }
267+ unsafe impl < T : UserEvent > Sync for Context < T > { }
268+
266269impl < T : UserEvent > Context < T > {
267270 pub fn run_threaded < R , F > ( & self , f : F ) -> R
268271 where
@@ -432,14 +435,6 @@ pub enum ActiveTracingSpan {
432435#[ derive( Debug ) ]
433436pub struct WindowsStore ( pub RefCell < BTreeMap < WindowId , WindowWrapper > > ) ;
434437
435- // SAFETY: we ensure this type is only used on the main thread.
436- #[ allow( clippy:: non_send_fields_in_send_ty) ]
437- unsafe impl Send for WindowsStore { }
438-
439- // SAFETY: we ensure this type is only used on the main thread.
440- #[ allow( clippy:: non_send_fields_in_send_ty) ]
441- unsafe impl Sync for WindowsStore { }
442-
443438#[ derive( Debug , Clone ) ]
444439pub struct DispatcherMainThreadContext < T : UserEvent > {
445440 pub window_target : EventLoopWindowTarget < Message < T > > ,
@@ -450,14 +445,6 @@ pub struct DispatcherMainThreadContext<T: UserEvent> {
450445 pub active_tracing_spans : ActiveTraceSpanStore ,
451446}
452447
453- // SAFETY: we ensure this type is only used on the main thread.
454- #[ allow( clippy:: non_send_fields_in_send_ty) ]
455- unsafe impl < T : UserEvent > Send for DispatcherMainThreadContext < T > { }
456-
457- // SAFETY: we ensure this type is only used on the main thread.
458- #[ allow( clippy:: non_send_fields_in_send_ty) ]
459- unsafe impl < T : UserEvent > Sync for DispatcherMainThreadContext < T > { }
460-
461448impl < T : UserEvent > fmt:: Debug for Context < T > {
462449 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
463450 f. debug_struct ( "Context" )
@@ -2843,6 +2830,7 @@ impl<T: UserEvent> Wry<T> {
28432830 let main_thread_id = current_thread ( ) . id ( ) ;
28442831 let web_context = WebContextStore :: default ( ) ;
28452832
2833+ #[ allow( clippy:: arc_with_non_send_sync) ]
28462834 let windows = Arc :: new ( WindowsStore ( RefCell :: new ( BTreeMap :: default ( ) ) ) ) ;
28472835 let window_id_map = WindowIdStore :: default ( ) ;
28482836
0 commit comments