Skip to content

Commit d6d54c3

Browse files
committed
some style and code improvements
- `is_some_and` => == `Some()` - force a statement onto a single line using `()` - combine two separate imports from smithay to one - import `input` from the smithay reexports, so i don't get a version conflict
1 parent 7fb236a commit d6d54c3

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

mayland-config/src/input.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ use serde::{
22
Deserialize,
33
de::{VariantAccess, Visitor},
44
};
5-
use smithay::input::keyboard::XkbConfig;
6-
use smithay::reexports::input::{AccelProfile, ClickMethod, ScrollMethod, TapButtonMap};
5+
use smithay::{
6+
input::keyboard::XkbConfig,
7+
reexports::input::{AccelProfile, ClickMethod, ScrollMethod, TapButtonMap},
8+
};
79

810
#[derive(Debug, Default, PartialEq, Eq)]
911
pub struct Input {

mayland-config/src/windowrules.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ impl<'v> Visitor<'v> for WindowRulesVis {
6161

6262
impl WindowRules {
6363
pub fn compute(&self, app_id: Option<&str>, title: Option<&str>) -> WindowRule {
64-
self.0
65-
.iter()
66-
.rev()
64+
(self.0.iter().rev())
6765
.filter_map(|(matcher, rule)| matcher.r#match(app_id, title).then_some(rule))
6866
.fold(WindowRule::default(), |acc, cur| WindowRule {
6967
floating: acc.floating.or(cur.floating),

src/input.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use crate::{
77
state::State,
88
utils::{RectExt, spawn},
99
};
10-
use input as libinput;
1110
use mayland_config::{Action, input::TabletMapping};
1211
use smithay::{
1312
backend::input::{
@@ -25,7 +24,10 @@ use smithay::{
2524
pointer::{AxisFrame, ButtonEvent, MotionEvent, RelativeMotionEvent},
2625
},
2726
output::Output,
28-
reexports::wayland_server::protocol::{wl_pointer, wl_surface::WlSurface},
27+
reexports::{
28+
input as libinput,
29+
wayland_server::protocol::{wl_pointer, wl_surface::WlSurface},
30+
},
2931
utils::{Logical, Point, SERIAL_COUNTER, Serial},
3032
wayland::{
3133
input_method::InputMethodSeat,

src/layout/workspace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ impl Workspace {
456456
}
457457

458458
fn remove_output(&mut self, output: &Output) {
459-
debug_assert!(self.output.as_ref().is_some_and(|wo| wo == output));
459+
debug_assert!(self.output.as_ref() == Some(output));
460460
self.output = None;
461461
}
462462

0 commit comments

Comments
 (0)