gardesk/tarmac / e39796f

Browse files

format monitor helpers

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
e39796fd9e9023ae7b34a397d13e5b8a63e6a940
Parents
315dfe6
Tree
9c0ded7

1 changed file

StatusFile+-
M tarmac/src/core/monitor.rs 2 8
tarmac/src/core/monitor.rsmodified
@@ -57,18 +57,12 @@ pub fn next_index_nowrap(monitors: &[Monitor], from: usize) -> Option<usize> {
5757
 pub fn prev_index_nowrap(monitors: &[Monitor], from: usize) -> Option<usize> {
5858
     let sorted = sorted_indices(monitors);
5959
     let pos = sorted.iter().position(|&i| i == from).unwrap_or(0);
60
-    if pos > 0 {
61
-        Some(sorted[pos - 1])
62
-    } else {
63
-        None
64
-    }
60
+    if pos > 0 { Some(sorted[pos - 1]) } else { None }
6561
 }
6662
 
6763
 /// Find which monitor index contains a screen point.
6864
 pub fn index_at_point(monitors: &[Monitor], x: f64, y: f64) -> Option<usize> {
69
-    monitors
70
-        .iter()
71
-        .position(|m| m.frame.contains_point(x, y))
65
+    monitors.iter().position(|m| m.frame.contains_point(x, y))
7266
 }
7367
 
7468
 #[cfg(test)]