From a4874beee07fdfe9a215676d2eeae1723288f563 Mon Sep 17 00:00:00 2001 From: Alexandre Bury Date: Fri, 13 Oct 2017 15:40:33 -0700 Subject: [PATCH] Use intermediate type Again, to fix a clippy warning. --- src/views/id_view.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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),