Compare commits
1 commit
7ea486dea6
...
03726a9950
Author | SHA1 | Date | |
---|---|---|---|
03726a9950 |
2 changed files with 3 additions and 3 deletions
|
@ -41,7 +41,7 @@ fn main() {
|
|||
if res.is_ok() {
|
||||
let v: Vec<Box<dyn Pattern>> = res.unwrap();
|
||||
for x in 0..v.len() {
|
||||
lights = *(v[x].execute(&mut lights));
|
||||
lights = v[x].execute(&mut lights);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ impl<'a> TryFrom<Vec<String>> for Box<dyn Pattern<'a>> {
|
|||
|
||||
struct Unit;
|
||||
impl<'a> Pattern<'a> for Unit {
|
||||
fn execute(&self, values: &'a mut RwLockWriteGuard<'_, [RawColor; crate::LED_SIZE]>) -> &'a mut RwLockWriteGuard<'_, [RawColor; crate::LED_SIZE]> {
|
||||
fn execute(&self, values: &'a mut RwLockWriteGuard<'_, [RawColor; crate::LED_SIZE]>) {
|
||||
values
|
||||
}
|
||||
fn parse(_args: Vec<String>) -> Result<Self, ParseError> {
|
||||
|
@ -40,7 +40,7 @@ struct Value {
|
|||
}
|
||||
|
||||
impl<'a> Pattern<'a> for Value {
|
||||
fn execute(&self, values: &'a mut RwLockWriteGuard<'_, [RawColor; crate::LED_SIZE]>) -> &'a mut RwLockWriteGuard<'_, [RawColor; crate::LED_SIZE]> {
|
||||
fn execute(&self, values: &'a mut RwLockWriteGuard<'_, [RawColor; crate::LED_SIZE]>) {
|
||||
for i in 0..crate::LED_SIZE {
|
||||
let mut color: RawColor = (*values)[i];
|
||||
if self.r.is_some() {
|
||||
|
|
Loading…
Reference in a new issue