Use intermediate type

Again, to fix a clippy warning.
This commit is contained in:
Alexandre Bury 2017-10-13 15:40:33 -07:00
parent 46dec4b0ca
commit a4874beee0

View File

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