This commit is contained in:
jane 2021-12-28 15:15:13 -05:00
parent dafac3d248
commit 96c50ae437

View file

@ -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<Vec<Box<dyn Pattern>>> = pattern.iter()
let res: Result<Vec<Box<dyn Pattern>>, ParseError> = pattern.iter()
.map(|x: &Vec<String>| parse_line((*x).clone()))
.collect();
if res.is_ok() {
let v: Vec<Box<dyn Pattern>> = res.unwrap();
for x in 0..v.len() {
let mut lights = lock.write().unwrap();
v[x].execute(&mut lights);
}
}