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> {
|
impl<T: View + 'static> ViewWrapper for IdView<T> {
|
||||||
type V = 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...
|
// Some for<'b> weirdness here to please the borrow checker gods...
|
||||||
fn wrap_call_on_any<'a>(
|
fn wrap_call_on_any<'a>(
|
||||||
&mut self, selector: &Selector,
|
&mut self, selector: &Selector, mut callback: BoxedCallback<'a>
|
||||||
mut callback: Box<for<'b> FnMut(&'b mut Any) + 'a>,
|
|
||||||
) {
|
) {
|
||||||
match selector {
|
match selector {
|
||||||
&Selector::Id(id) if id == self.id => callback(self),
|
&Selector::Id(id) if id == self.id => callback(self),
|
||||||
|
Loading…
Reference in New Issue
Block a user