Commit d12dfba5 authored by Florian Blasius's avatar Florian Blasius 🤘

Fix warnings.

parent c123e0ed
Pipeline #4665 failed with stages
in 1 minute and 54 seconds
......@@ -82,8 +82,8 @@ impl shell::WindowAdapter for WindowAdapter {
}
}
impl Into<Box<shell::WindowAdapter>> for WindowAdapter {
fn into(self) -> Box<shell::WindowAdapter> {
impl Into<Box<dyn shell::WindowAdapter>> for WindowAdapter {
fn into(self) -> Box<dyn shell::WindowAdapter> {
Box::new(self)
}
}
......@@ -16,7 +16,7 @@ pub struct KeyUpEvent {
impl Event for KeyUpEvent {}
pub type KeyHandler = Fn(Key) -> bool + 'static;
pub type KeyHandler = dyn Fn(Key) -> bool + 'static;
/// Used to handle key down events. Could be attached to a widget.
pub struct KeyDownEventHandler {
......
......@@ -45,7 +45,7 @@ pub struct MouseDownEvent {
impl Event for MouseDownEvent {}
pub type MouseHandler = Fn(Point) -> bool + 'static;
pub type MouseHandler = dyn Fn(Point) -> bool + 'static;
/// Used to handle click events. Could be attached to a widget.
pub struct ClickEventHandler {
......
......@@ -75,7 +75,7 @@ impl<'a> BuildContext<'a> {
}
/// Registers a state with a widget.
pub fn register_state(&self, widget: Entity, state: Rc<State>) {
pub fn register_state(&self, widget: Entity, state: Rc<dyn State>) {
self.states.borrow_mut().insert(widget, state);
}
......
......@@ -247,7 +247,7 @@ impl<'a> Context<'a> {
&mut self.window_shell.canvas
}
pub fn renderer(&mut self) -> &mut Renderer {
pub fn renderer(&mut self) -> &mut dyn Renderer {
&mut self.window_shell.inner
}
......
......@@ -58,7 +58,7 @@ pub trait Widget: Template {
fn insert_handler(self, handler: impl Into<Rc<dyn EventHandler>>) -> Self;
/// Returns the state of the widget.
fn state(&self) -> Option<Rc<State>> {
fn state(&self) -> Option<Rc<dyn State>> {
None
}
......
......@@ -150,7 +150,7 @@ pub struct ShellRunner<A> where A: WindowAdapter {
pub window_shell: Rc<RefCell<WindowShell<A>>>,
pub update: Rc<Cell<bool>>,
pub running: Rc<Cell<bool>>,
pub updater: Box<Updater>,
pub updater: Box<dyn Updater>,
}
impl<A> ShellRunner<A> where A: WindowAdapter {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment