summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2020-08-06 01:09:46 +0000
committerGitHub <noreply@github.com>2020-08-06 01:09:46 +0000
commitc478a9fc526828d7d05c7e6189126b47ec4b8122 (patch)
tree8bc6b1348d942cc8f6a7c6d78e324be006e3a133
parent291de2500f0cbd189a9b017809091b6eb8f8f0ec (diff)
downloadalacritty-c478a9fc526828d7d05c7e6189126b47ec4b8122.tar.gz
alacritty-c478a9fc526828d7d05c7e6189126b47ec4b8122.zip
Fix clippy issues
Co-authored-by: Kirill Chibisov <contact@kchibisov.com>
-rw-r--r--alacritty/src/event.rs22
-rw-r--r--alacritty/src/window.rs14
2 files changed, 13 insertions, 23 deletions
diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs
index 85dca0ee..9e6dde16 100644
--- a/alacritty/src/event.rs
+++ b/alacritty/src/event.rs
@@ -1017,18 +1017,18 @@ impl<N: Notify + OnResize> Processor<N> {
/// Check if an event is irrelevant and can be skipped.
fn skip_event(event: &GlutinEvent<Event>) -> bool {
match event {
- GlutinEvent::WindowEvent { event, .. } => match event {
+ GlutinEvent::WindowEvent { event, .. } => matches!(
+ event,
WindowEvent::KeyboardInput { is_synthetic: true, .. }
- | WindowEvent::TouchpadPressure { .. }
- | WindowEvent::CursorEntered { .. }
- | WindowEvent::AxisMotion { .. }
- | WindowEvent::HoveredFileCancelled
- | WindowEvent::Destroyed
- | WindowEvent::HoveredFile(_)
- | WindowEvent::Touch(_)
- | WindowEvent::Moved(_) => true,
- _ => false,
- },
+ | WindowEvent::TouchpadPressure { .. }
+ | WindowEvent::CursorEntered { .. }
+ | WindowEvent::AxisMotion { .. }
+ | WindowEvent::HoveredFileCancelled
+ | WindowEvent::Destroyed
+ | WindowEvent::HoveredFile(_)
+ | WindowEvent::Touch(_)
+ | WindowEvent::Moved(_)
+ ),
GlutinEvent::Suspended { .. }
| GlutinEvent::NewEvents { .. }
| GlutinEvent::MainEventsCleared
diff --git a/alacritty/src/window.rs b/alacritty/src/window.rs
index bfe7360a..3319dce8 100644
--- a/alacritty/src/window.rs
+++ b/alacritty/src/window.rs
@@ -244,11 +244,6 @@ impl Window {
#[cfg(not(any(target_os = "macos", windows)))]
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)
.expect("loading icon")
.to_rgba();
@@ -261,7 +256,7 @@ impl Window {
.with_title(title)
.with_visible(false)
.with_transparent(true)
- .with_decorations(decorations)
+ .with_decorations(window_config.decorations != Decorations::None)
.with_maximized(window_config.startup_mode == StartupMode::Maximized)
.with_window_icon(icon.ok())
// X11.
@@ -278,17 +273,12 @@ impl Window {
#[cfg(windows)]
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);
WindowBuilder::new()
.with_title(title)
.with_visible(false)
- .with_decorations(decorations)
+ .with_decorations(window_config.decorations != Decorations::None)
.with_transparent(true)
.with_maximized(window_config.startup_mode == StartupMode::Maximized)
.with_window_icon(icon.ok())