diff --git a/src/main.rs b/src/main.rs index ac3ce0c..76b710e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -32,15 +32,15 @@ fn main() { }); loop { thread::sleep(time::Duration::from_millis(250)); - let mut lights = lock.write().unwrap(); let pattern = format_multiline("unit"); - let res: Result>> = pattern.iter() + let res: Result>, ParseError> = pattern.iter() .map(|x: &Vec| parse_line((*x).clone())) .collect(); 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); } }