Compare commits
1 commit
9d39ce125a
...
b9b1332814
Author | SHA1 | Date | |
---|---|---|---|
b9b1332814 |
2 changed files with 2 additions and 2 deletions
|
@ -36,7 +36,7 @@ fn main() {
|
||||||
let pattern = format_multiline("val 255 150 0");
|
let pattern = format_multiline("val 255 150 0");
|
||||||
pattern.iter()
|
pattern.iter()
|
||||||
.map(|x: &Vec<String>| parse_line((*x).clone()))
|
.map(|x: &Vec<String>| parse_line((*x).clone()))
|
||||||
.for_each(|res: Result<Box<dyn Pattern>, ParseError>| {
|
.for_each(|res| {
|
||||||
if res.is_ok() {
|
if res.is_ok() {
|
||||||
res.unwrap().execute(&mut lights);
|
res.unwrap().execute(&mut lights);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ use std::{
|
||||||
};
|
};
|
||||||
use std::sync::RwLockWriteGuard;
|
use std::sync::RwLockWriteGuard;
|
||||||
|
|
||||||
pub type ParseError = Box<dyn std::error::Error>;
|
type ParseError = Box<dyn std::error::Error>;
|
||||||
|
|
||||||
pub trait Pattern<'a> {
|
pub trait Pattern<'a> {
|
||||||
fn execute(&self, values: &'a mut RwLockWriteGuard<'_, [RawColor; crate::LED_SIZE]>);
|
fn execute(&self, values: &'a mut RwLockWriteGuard<'_, [RawColor; crate::LED_SIZE]>);
|
||||||
|
|
Loading…
Reference in a new issue