Compare commits

..

1 commit

Author SHA1 Message Date
b96f0d80db deref syntax? 2021-12-26 21:37:22 -05:00

View file

@ -41,7 +41,7 @@ impl<'a> Pattern<'a> for Value {
fn execute(&self, values: &'a mut RwLockWriteGuard<'_, [RawColor; crate::LED_SIZE]>) { fn execute(&self, values: &'a mut RwLockWriteGuard<'_, [RawColor; crate::LED_SIZE]>) {
let mut v = *values; let mut v = *values;
for i in 0..crate::LED_SIZE { for i in 0..crate::LED_SIZE {
let color: RawColor = v[i]; let mut color: RawColor = v[i];
if self.r.is_some() { if self.r.is_some() {
color[0] = self.r.unwrap(); color[0] = self.r.unwrap();
} }
@ -97,7 +97,7 @@ impl<'a> Pattern<'a> for Value {
} }
} }
pub fn parse_line(v: Vec<String>) -> Result<Box<dyn Pattern<'static>>, ParseError> { pub fn parse_line(v: Vec<String>) -> Result<Box<dyn Pattern<'_>>, ParseError> {
let res: Result<Box<dyn Pattern>, ParseError> = v.try_into(); let res: Result<Box<dyn Pattern>, ParseError> = v.try_into();
res res
} }