mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 17:35:00 +00:00
Use intermediate type
Again, to fix a clippy warning.
This commit is contained in:
parent
46dec4b0ca
commit
a4874beee0
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user