mirror of
https://github.com/italicsjenga/rust_minifb.git
synced 2025-01-11 11:31:32 +11:00
Fixed some compiler warnings
This commit is contained in:
parent
29721b0eeb
commit
b62382bf0c
|
@ -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,
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue