Fix clippy issues
Co-authored-by: Kirill Chibisov <contact@kchibisov.com>
This commit is contained in:
parent
291de2500f
commit
c478a9fc52
|
@ -1017,7 +1017,8 @@ impl<N: Notify + OnResize> Processor<N> {
|
||||||
/// Check if an event is irrelevant and can be skipped.
|
/// Check if an event is irrelevant and can be skipped.
|
||||||
fn skip_event(event: &GlutinEvent<Event>) -> bool {
|
fn skip_event(event: &GlutinEvent<Event>) -> bool {
|
||||||
match event {
|
match event {
|
||||||
GlutinEvent::WindowEvent { event, .. } => match event {
|
GlutinEvent::WindowEvent { event, .. } => matches!(
|
||||||
|
event,
|
||||||
WindowEvent::KeyboardInput { is_synthetic: true, .. }
|
WindowEvent::KeyboardInput { is_synthetic: true, .. }
|
||||||
| WindowEvent::TouchpadPressure { .. }
|
| WindowEvent::TouchpadPressure { .. }
|
||||||
| WindowEvent::CursorEntered { .. }
|
| WindowEvent::CursorEntered { .. }
|
||||||
|
@ -1026,9 +1027,8 @@ impl<N: Notify + OnResize> Processor<N> {
|
||||||
| WindowEvent::Destroyed
|
| WindowEvent::Destroyed
|
||||||
| WindowEvent::HoveredFile(_)
|
| WindowEvent::HoveredFile(_)
|
||||||
| WindowEvent::Touch(_)
|
| WindowEvent::Touch(_)
|
||||||
| WindowEvent::Moved(_) => true,
|
| WindowEvent::Moved(_)
|
||||||
_ => false,
|
),
|
||||||
},
|
|
||||||
GlutinEvent::Suspended { .. }
|
GlutinEvent::Suspended { .. }
|
||||||
| GlutinEvent::NewEvents { .. }
|
| GlutinEvent::NewEvents { .. }
|
||||||
| GlutinEvent::MainEventsCleared
|
| GlutinEvent::MainEventsCleared
|
||||||
|
|
|
@ -244,11 +244,6 @@ impl Window {
|
||||||
|
|
||||||
#[cfg(not(any(target_os = "macos", windows)))]
|
#[cfg(not(any(target_os = "macos", windows)))]
|
||||||
pub fn get_platform_window(title: &str, window_config: &WindowConfig) -> WindowBuilder {
|
pub fn get_platform_window(title: &str, window_config: &WindowConfig) -> WindowBuilder {
|
||||||
let decorations = match window_config.decorations {
|
|
||||||
Decorations::None => false,
|
|
||||||
_ => true,
|
|
||||||
};
|
|
||||||
|
|
||||||
let image = image::load_from_memory_with_format(WINDOW_ICON, ImageFormat::Ico)
|
let image = image::load_from_memory_with_format(WINDOW_ICON, ImageFormat::Ico)
|
||||||
.expect("loading icon")
|
.expect("loading icon")
|
||||||
.to_rgba();
|
.to_rgba();
|
||||||
|
@ -261,7 +256,7 @@ impl Window {
|
||||||
.with_title(title)
|
.with_title(title)
|
||||||
.with_visible(false)
|
.with_visible(false)
|
||||||
.with_transparent(true)
|
.with_transparent(true)
|
||||||
.with_decorations(decorations)
|
.with_decorations(window_config.decorations != Decorations::None)
|
||||||
.with_maximized(window_config.startup_mode == StartupMode::Maximized)
|
.with_maximized(window_config.startup_mode == StartupMode::Maximized)
|
||||||
.with_window_icon(icon.ok())
|
.with_window_icon(icon.ok())
|
||||||
// X11.
|
// X11.
|
||||||
|
@ -278,17 +273,12 @@ impl Window {
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
pub fn get_platform_window(title: &str, window_config: &WindowConfig) -> WindowBuilder {
|
pub fn get_platform_window(title: &str, window_config: &WindowConfig) -> WindowBuilder {
|
||||||
let decorations = match window_config.decorations {
|
|
||||||
Decorations::None => false,
|
|
||||||
_ => true,
|
|
||||||
};
|
|
||||||
|
|
||||||
let icon = Icon::from_resource(IDI_ICON, None);
|
let icon = Icon::from_resource(IDI_ICON, None);
|
||||||
|
|
||||||
WindowBuilder::new()
|
WindowBuilder::new()
|
||||||
.with_title(title)
|
.with_title(title)
|
||||||
.with_visible(false)
|
.with_visible(false)
|
||||||
.with_decorations(decorations)
|
.with_decorations(window_config.decorations != Decorations::None)
|
||||||
.with_transparent(true)
|
.with_transparent(true)
|
||||||
.with_maximized(window_config.startup_mode == StartupMode::Maximized)
|
.with_maximized(window_config.startup_mode == StartupMode::Maximized)
|
||||||
.with_window_icon(icon.ok())
|
.with_window_icon(icon.ok())
|
||||||
|
|
Loading…
Reference in New Issue