Fixed some compiler warnings

This commit is contained in:
Daniel Collin 2019-07-21 10:37:47 +02:00
parent 29721b0eeb
commit b62382bf0c
4 changed files with 6 additions and 6 deletions

View file

@ -25,7 +25,7 @@ impl StdError for Error {
} }
} }
fn cause(&self) -> Option<&StdError> { fn cause(&self) -> Option<&dyn StdError> {
match *self { match *self {
Error::MenusNotSupported => None, Error::MenusNotSupported => None,
Error::MenuExists(_) => None, Error::MenuExists(_) => None,

View file

@ -4,7 +4,7 @@ use std::mem;
use {Key, KeyRepeat, InputCallback}; use {Key, KeyRepeat, InputCallback};
pub struct KeyHandler { pub struct KeyHandler {
pub key_callback: Option<Box<InputCallback>>, pub key_callback: Option<Box<dyn InputCallback>>,
prev_time: f64, prev_time: f64,
delta_time: f32, delta_time: f32,
keys: [bool; 512], keys: [bool; 512],
@ -70,7 +70,7 @@ impl KeyHandler {
} }
} }
pub fn set_input_callback(&mut self, callback: Box<InputCallback>) { pub fn set_input_callback(&mut self, callback: Box<dyn InputCallback>) {
self.key_callback = Some(callback); self.key_callback = Some(callback);
} }

View file

@ -512,7 +512,7 @@ impl Window {
/// Set input callback to recive callback on char input /// Set input callback to recive callback on char input
/// ///
#[inline] #[inline]
pub fn set_input_callback(&mut self, callback: Box<InputCallback>) { pub fn set_input_callback(&mut self, callback: Box<dyn InputCallback>) {
self.0.set_input_callback(callback) self.0.set_input_callback(callback)
} }

View file

@ -534,7 +534,7 @@ impl Window {
} }
#[inline] #[inline]
pub fn set_input_callback(&mut self, callback: Box<InputCallback>) { pub fn set_input_callback(&mut self, callback: Box<dyn InputCallback>) {
self.key_handler.set_input_callback(callback) self.key_handler.set_input_callback(callback)
} }