diff --git a/src/util/pattern.rs b/src/util/pattern.rs index a6527cc..7970092 100644 --- a/src/util/pattern.rs +++ b/src/util/pattern.rs @@ -11,7 +11,7 @@ trait Pattern<'a> { fn parse(args: Vec) -> Result; } -impl TryFrom> for Box { +impl<'a> TryFrom> for Box> { fn try_from(s: Vec) -> Result { match s[0].as_str() { "unit" => Unit::parse(s), @@ -22,7 +22,7 @@ impl TryFrom> for Box { } struct Unit; -impl<'a> Pattern for Unit<'a> { +impl<'a> Pattern<'a> for Unit { fn execute(&self, values: &'a mut [RawColor]) {} fn parse(args: Vec) -> Result { Ok(Unit {}) @@ -35,7 +35,7 @@ struct Value { b: Option } -impl<'a> Pattern for Value<'a> { +impl<'a> Pattern<'a> for Value { fn execute(&self, values: &'a mut [RawColor]) { for i in 0..crate::LED_SIZE { let color: RawColor = values[i]; @@ -93,7 +93,7 @@ impl<'a> Pattern for Value<'a> { } } -pub fn parse_line(v: Vec) -> Result, ParseError> { +pub fn parse_line(v: Vec) -> Result>, ParseError> { let res: Result, ParseError> = v.try_into(); res } \ No newline at end of file