Compare commits

..

1 commit

Author SHA1 Message Date
04df670b63 move parse out of loop 2021-12-28 15:43:21 -05:00

View file

@ -30,8 +30,8 @@ fn main() {
run_lights(&mut controller, &lights).expect("Error running lights controller."); run_lights(&mut controller, &lights).expect("Error running lights controller.");
} }
}); });
let mul_string = format_multiline("unit"); let pattern = format_multiline("unit");
let res: Result<Vec<Box<dyn Pattern>>, ParseError> = mul_string.iter() let res: Result<Vec<Box<dyn Pattern>>, ParseError> = pattern.iter()
.map(|x: &Vec<String>| parse_line((*x).clone())) .map(|x: &Vec<String>| parse_line((*x).clone()))
.collect(); .collect();
if res.is_ok() { if res.is_ok() {