mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 17:35:00 +00:00
Fix clippy warning
This commit is contained in:
parent
aeb0d88987
commit
038294339d
@ -6,6 +6,9 @@ use crate::view::{Selector, View};
|
|||||||
use crate::Printer;
|
use crate::Printer;
|
||||||
use crate::With;
|
use crate::With;
|
||||||
|
|
||||||
|
// Define this type separately to appease the Clippy god
|
||||||
|
type CallOnAny<T> = Box<dyn for<'a> FnMut(&mut T, &Selector, AnyCb<'a>)>;
|
||||||
|
|
||||||
/// A blank view that forwards calls to closures.
|
/// A blank view that forwards calls to closures.
|
||||||
///
|
///
|
||||||
/// You can use this view to easily draw your own interface.
|
/// You can use this view to easily draw your own interface.
|
||||||
@ -19,7 +22,7 @@ pub struct Canvas<T> {
|
|||||||
take_focus: Box<dyn FnMut(&mut T, Direction) -> bool>,
|
take_focus: Box<dyn FnMut(&mut T, Direction) -> bool>,
|
||||||
needs_relayout: Box<dyn Fn(&T) -> bool>,
|
needs_relayout: Box<dyn Fn(&T) -> bool>,
|
||||||
focus_view: Box<dyn FnMut(&mut T, &Selector) -> Result<(), ()>>,
|
focus_view: Box<dyn FnMut(&mut T, &Selector) -> Result<(), ()>>,
|
||||||
call_on_any: Box<dyn for<'a> FnMut(&mut T, &Selector, AnyCb<'a>)>,
|
call_on_any: CallOnAny<T>,
|
||||||
important_area: Box<dyn Fn(&T, Vec2) -> Rect>,
|
important_area: Box<dyn Fn(&T, Vec2) -> Rect>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user