diff --git a/src/actions.rs b/src/actions.rs index c05995f..3bec644 100644 --- a/src/actions.rs +++ b/src/actions.rs @@ -95,7 +95,7 @@ impl FromStr for Actions { /// Creates a new `Actions` with LURD format string. fn from_str(lurd: &str) -> Result { if lurd.contains(char::is_numeric) { - return Actions::from_str(&rle_decode(lurd).unwrap()); + return Actions::from_str(&rle_decode(lurd)?); } let mut instance = Actions::default(); for char in lurd.chars() { diff --git a/src/error.rs b/src/error.rs index 7e1d6d6..32d2289 100644 --- a/src/error.rs +++ b/src/error.rs @@ -52,6 +52,9 @@ pub enum ParseActionError { /// Contains non-LURD format character. #[error("invalid character: `{0}`")] InvalidCharacter(char), + /// An error occurred during RLE decoding. + #[error(transparent)] + DecodeRleError(#[from] DecodeRleError), } /// An error which can be returned when encoding RLE.