diff --git a/src/views/id_view.rs b/src/views/id_view.rs index 94e817e..d5d2756 100644 --- a/src/views/id_view.rs +++ b/src/views/id_view.rs @@ -40,6 +40,9 @@ impl IdView { } } +// Shortcut for a boxed callback (for the wrap_call_on_any method). +type BoxedCallback<'a> = Box FnMut(&'b mut Any) + 'a>; + impl ViewWrapper for IdView { type V = T; @@ -59,8 +62,7 @@ impl ViewWrapper for IdView { // Some for<'b> weirdness here to please the borrow checker gods... fn wrap_call_on_any<'a>( - &mut self, selector: &Selector, - mut callback: Box FnMut(&'b mut Any) + 'a>, + &mut self, selector: &Selector, mut callback: BoxedCallback<'a> ) { match selector { &Selector::Id(id) if id == self.id => callback(self),