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 {
Error::MenusNotSupported => None,
Error::MenuExists(_) => None,

View file

@ -4,7 +4,7 @@ use std::mem;
use {Key, KeyRepeat, InputCallback};
pub struct KeyHandler {
pub key_callback: Option<Box<InputCallback>>,
pub key_callback: Option<Box<dyn InputCallback>>,
prev_time: f64,
delta_time: f32,
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);
}

View file

@ -464,7 +464,7 @@ impl Window {
///
/// Check if a single key was released since last call to update.
///
///
#[inline]
pub fn is_key_released(&self, key: Key) -> bool {
self.0.is_key_released(key)
@ -512,7 +512,7 @@ impl Window {
/// Set input callback to recive callback on char input
///
#[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)
}

View file

@ -534,7 +534,7 @@ impl Window {
}
#[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)
}