Split if into two for readability
Browse files at this commit2ca9f3ff80a62e69ab6a81c6124a8ac861206f63Parent: c39b8a41 changed file +12 -9
- src/input.rs +12 -9
src/input.rsmodified+12 -9
| @@ -77,15 +77,18 @@ impl State { | |||
| 77 | }; | 77 | }; |
| 78 | 78 | ||
| 79 | // Filter actions when the key is released or the session is locked. | 79 | // Filter actions when the key is released or the session is locked. |
| 80 | - if !pressed | 80 | + if !pressed { |
| 81 | - || self.niri.is_locked() | 81 | + return; |
| 82 | - && !matches!( | 82 | + } |
| 83 | - action, | 83 | + |
| 84 | - Action::Quit | 84 | + if self.niri.is_locked() |
| 85 | - | Action::ChangeVt(_) | 85 | + && !matches!( |
| 86 | - | Action::Suspend | 86 | + action, |
| 87 | - | Action::PowerOffMonitors | 87 | + Action::Quit |
| 88 | - ) | 88 | + | Action::ChangeVt(_) |
| 89 | + | Action::Suspend | ||
| 90 | + | Action::PowerOffMonitors | ||
| 91 | + ) | ||
| 89 | { | 92 | { |
| 90 | return; | 93 | return; |
| 91 | } | 94 | } |