diff --git a/src/main.rs b/src/main.rs index 76b710e..48352ed 100644 --- a/src/main.rs +++ b/src/main.rs @@ -32,6 +32,7 @@ fn main() { }); loop { thread::sleep(time::Duration::from_millis(250)); + let mut lights = lock.write().unwrap(); let pattern = format_multiline("unit"); let res: Result>, ParseError> = pattern.iter() .map(|x: &Vec| parse_line((*x).clone())) @@ -40,7 +41,6 @@ fn main() { if res.is_ok() { let v: Vec> = res.unwrap(); for x in 0..v.len() { - let mut lights = lock.write().unwrap(); v[x].execute(&mut lights); } }