diff --git a/src/aztec/encoder/token.rs b/src/aztec/encoder/token.rs index 7437b8f..5111904 100644 --- a/src/aztec/encoder/token.rs +++ b/src/aztec/encoder/token.rs @@ -31,9 +31,9 @@ impl TokenType { match self { TokenType::Simple(a) => a.appendTo(bit_array, text), TokenType::BinaryShift(a) => a.appendTo(bit_array, text), - TokenType::Empty => Err(Exceptions::illegalState(String::from( + TokenType::Empty => Err(Exceptions::illegalState( "cannot appendTo on Empty final item", - ))), + )), } } } diff --git a/src/client/result/ResultParser.rs b/src/client/result/ResultParser.rs index f2525c4..960eb05 100644 --- a/src/client/result/ResultParser.rs +++ b/src/client/result/ResultParser.rs @@ -300,9 +300,7 @@ pub fn urlDecode(encoded: &str) -> Result { if let Ok(decoded) = decode(encoded) { Ok(decoded.to_string()) } else { - Err(Exceptions::illegalState(String::from( - "UnsupportedEncodingException", - ))) + Err(Exceptions::illegalState("UnsupportedEncodingException")) } } diff --git a/src/client/result/VINResultParser.rs b/src/client/result/VINResultParser.rs index 842da2d..6ee41a1 100644 --- a/src/client/result/VINResultParser.rs +++ b/src/client/result/VINResultParser.rs @@ -124,9 +124,9 @@ fn model_year(c: char) -> Result { 'V'..='Y' => Ok((c as u8 as u32 - b'V' as u32) + 1997), '1'..='9' => Ok((c as u8 as u32 - b'1' as u32) + 2001), 'A'..='D' => Ok((c as u8 as u32 - b'A' as u32) + 2010), - _ => Err(Exceptions::illegalArgument(String::from( + _ => Err(Exceptions::illegalArgument( "model year argument out of range", - ))), + )), } } diff --git a/src/common/reedsolomon/generic_gf_poly.rs b/src/common/reedsolomon/generic_gf_poly.rs index f0a8d78..2d334ad 100644 --- a/src/common/reedsolomon/generic_gf_poly.rs +++ b/src/common/reedsolomon/generic_gf_poly.rs @@ -49,9 +49,7 @@ impl GenericGFPoly { */ pub fn new(field: GenericGFRef, coefficients: &[i32]) -> Result { if coefficients.is_empty() { - return Err(Exceptions::illegalArgument(String::from( - "coefficients cannot be empty", - ))); + return Err(Exceptions::illegalArgument("coefficients cannot be empty")); } Ok(Self { field,