diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2025-01-10 09:01:23 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-01-10 09:11:31 +0300 |
| commit | 623687e59baa21c23c2c854b1815cb29e9c5917e (patch) | |
| tree | 99dbb0f47bec0a5eb8d1454534e6bd100efaf6a8 /src/layout | |
| parent | 5958d3be62b3abe21613567af28beb4d7d118205 (diff) | |
| download | niri-623687e59baa21c23c2c854b1815cb29e9c5917e.tar.gz niri-623687e59baa21c23c2c854b1815cb29e9c5917e.tar.bz2 niri-623687e59baa21c23c2c854b1815cb29e9c5917e.zip | |
Fix new Clippy warnings
Diffstat (limited to 'src/layout')
| -rw-r--r-- | src/layout/mod.rs | 16 | ||||
| -rw-r--r-- | src/layout/monitor.rs | 6 | ||||
| -rw-r--r-- | src/layout/scrolling.rs | 4 |
3 files changed, 13 insertions, 13 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 2c241221..f2baa11d 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -1194,7 +1194,7 @@ impl<W: LayoutElement> Layout<W> { mon.workspaces.iter().enumerate().find(|(_, w)| { w.name .as_ref() - .map_or(false, |name| name.eq_ignore_ascii_case(workspace_name)) + .is_some_and(|name| name.eq_ignore_ascii_case(workspace_name)) }) { return Some((index, workspace)); @@ -1205,7 +1205,7 @@ impl<W: LayoutElement> Layout<W> { if let Some((index, workspace)) = workspaces.iter().enumerate().find(|(_, w)| { w.name .as_ref() - .map_or(false, |name| name.eq_ignore_ascii_case(workspace_name)) + .is_some_and(|name| name.eq_ignore_ascii_case(workspace_name)) }) { return Some((index, workspace)); } @@ -1229,7 +1229,7 @@ impl<W: LayoutElement> Layout<W> { WorkspaceReference::Name(ref_name) => ws .name .as_ref() - .map_or(false, |name| name.eq_ignore_ascii_case(ref_name)), + .is_some_and(|name| name.eq_ignore_ascii_case(ref_name)), WorkspaceReference::Id(id) => ws.id().get() == *id, WorkspaceReference::Index(_) => unreachable!(), }) @@ -1657,7 +1657,7 @@ impl<W: LayoutElement> Layout<W> { monitor.workspaces.iter().any(|ws| { ws.name .as_ref() - .map_or(false, |name| name.eq_ignore_ascii_case(workspace_name)) + .is_some_and(|name| name.eq_ignore_ascii_case(workspace_name)) }) }) } @@ -2427,7 +2427,7 @@ impl<W: LayoutElement> Layout<W> { }; for mon in monitors { - if output.map_or(false, |output| mon.output != *output) { + if output.is_some_and(|output| mon.output != *output) { continue; } @@ -2510,7 +2510,7 @@ impl<W: LayoutElement> Layout<W> { let Some(InteractiveMoveState::Moving(move_)) = self.interactive_move.take() else { unreachable!() }; - if output.map_or(false, |out| &move_.output != out) { + if output.is_some_and(|out| &move_.output != out) { self.interactive_move = Some(InteractiveMoveState::Moving(move_)); return; } @@ -4980,7 +4980,7 @@ mod tests { if ws .name .as_ref() - .map_or(false, |name| name.eq_ignore_ascii_case(&ws_name)) + .is_some_and(|name| name.eq_ignore_ascii_case(&ws_name)) { ws_id = Some(ws.id()); } @@ -4998,7 +4998,7 @@ mod tests { if ws .name .as_ref() - .map_or(false, |name| name.eq_ignore_ascii_case(&ws_name)) + .is_some_and(|name| name.eq_ignore_ascii_case(&ws_name)) { ws_id = Some(ws.id()); } diff --git a/src/layout/monitor.rs b/src/layout/monitor.rs index 70009d67..8bb92a33 100644 --- a/src/layout/monitor.rs +++ b/src/layout/monitor.rs @@ -165,7 +165,7 @@ impl<W: LayoutElement> Monitor<W> { self.workspaces.iter().find(|ws| { ws.name .as_ref() - .map_or(false, |name| name.eq_ignore_ascii_case(workspace_name)) + .is_some_and(|name| name.eq_ignore_ascii_case(workspace_name)) }) } @@ -173,7 +173,7 @@ impl<W: LayoutElement> Monitor<W> { self.workspaces.iter().position(|ws| { ws.name .as_ref() - .map_or(false, |name| name.eq_ignore_ascii_case(workspace_name)) + .is_some_and(|name| name.eq_ignore_ascii_case(workspace_name)) }) } @@ -1074,7 +1074,7 @@ impl<W: LayoutElement> Monitor<W> { return false; }; - if is_touchpad.map_or(false, |x| gesture.is_touchpad != x) { + if is_touchpad.is_some_and(|x| gesture.is_touchpad != x) { return false; } diff --git a/src/layout/scrolling.rs b/src/layout/scrolling.rs index e54beccb..84ad835e 100644 --- a/src/layout/scrolling.rs +++ b/src/layout/scrolling.rs @@ -2469,7 +2469,7 @@ impl<W: LayoutElement> ScrollingSpace<W> { return false; }; - if is_touchpad.map_or(false, |x| gesture.is_touchpad != x) { + if is_touchpad.is_some_and(|x| gesture.is_touchpad != x) { return false; } @@ -3034,7 +3034,7 @@ impl TileData { self.interactively_resizing_by_left_edge = tile .window() .interactive_resize_data() - .map_or(false, |data| data.edges.contains(ResizeEdge::LEFT)); + .is_some_and(|data| data.edges.contains(ResizeEdge::LEFT)); } } |
