From 269f2ab521f7c2446959ddb644f68c960c7acc44 Mon Sep 17 00:00:00 2001 From: Alexandre Bury Date: Tue, 18 Jun 2019 11:35:42 -0700 Subject: [PATCH] Add dyn to trait objects --- src/cursive.rs | 2 +- src/event.rs | 2 +- src/view/view_wrapper.rs | 2 +- src/views/hideable_view.rs | 2 +- src/views/id_view.rs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cursive.rs b/src/cursive.rs index d9380f5..495da61 100644 --- a/src/cursive.rs +++ b/src/cursive.rs @@ -47,7 +47,7 @@ pub struct Cursive { cb_sink: Sender>, // User-provided data. - user_data: Box, + user_data: Box, fps: Option, boring_frame_count: u32, diff --git a/src/event.rs b/src/event.rs index a9ebe16..239934d 100644 --- a/src/event.rs +++ b/src/event.rs @@ -27,7 +27,7 @@ pub struct Callback(Rc>); // TODO: remove the Box when Box -> Rc is possible /// A boxed callback that can be run on `&mut Any`. -pub type AnyCb<'a> = Box; +pub type AnyCb<'a> = Box; /// A trigger that only selects some types of events. pub struct EventTrigger(Box bool>); diff --git a/src/view/view_wrapper.rs b/src/view/view_wrapper.rs index cd02340..7a46a3f 100644 --- a/src/view/view_wrapper.rs +++ b/src/view/view_wrapper.rs @@ -126,7 +126,7 @@ impl View for T { fn call_on_any<'a>( &mut self, selector: &Selector<'_>, - callback: Box, + callback: Box, ) { self.wrap_call_on_any(selector, callback) } diff --git a/src/views/hideable_view.rs b/src/views/hideable_view.rs index c19ba90..9458742 100644 --- a/src/views/hideable_view.rs +++ b/src/views/hideable_view.rs @@ -92,7 +92,7 @@ impl ViewWrapper for HideableView { fn wrap_call_on_any<'a>( &mut self, selector: &Selector<'_>, - callback: Box, + callback: Box, ) { // We always run callbacks, even when invisible. self.view.call_on_any(selector, callback) diff --git a/src/views/id_view.rs b/src/views/id_view.rs index 39cd201..7800615 100644 --- a/src/views/id_view.rs +++ b/src/views/id_view.rs @@ -42,7 +42,7 @@ impl IdView { } // Shortcut for a boxed callback (for the wrap_call_on_any method). -type BoxedCallback<'a> = Box FnMut(&'b mut dyn Any) + 'a>; +type BoxedCallback<'a> = Box FnMut(&'b mut dyn Any) + 'a>; impl ViewWrapper for IdView { type V = T;