@@ -88,11 +88,11 @@ impl SupportsFastDecodeAndEncode for Base64SimdWrapper {
8888 let segment_len = blocks * 4 ;
8989
9090 if segment_len > remaining. len ( ) {
91- return Err ( USimpleError :: new ( 1 , "error: invalid input" . to_owned ( ) ) ) ;
91+ return Err ( USimpleError :: new ( 1 , "error: invalid input" ) ) ;
9292 }
9393
9494 if Self :: decode_with_standard ( & remaining[ ..segment_len] , output) . is_err ( ) {
95- return Err ( USimpleError :: new ( 1 , "error: invalid input" . to_owned ( ) ) ) ;
95+ return Err ( USimpleError :: new ( 1 , "error: invalid input" ) ) ;
9696 }
9797
9898 start += segment_len;
@@ -107,7 +107,7 @@ impl SupportsFastDecodeAndEncode for Base64SimdWrapper {
107107 } ;
108108
109109 if decoder ( remaining, output) . is_err ( ) {
110- return Err ( USimpleError :: new ( 1 , "error: invalid input" . to_owned ( ) ) ) ;
110+ return Err ( USimpleError :: new ( 1 , "error: invalid input" ) ) ;
111111 }
112112
113113 break ;
@@ -117,7 +117,7 @@ impl SupportsFastDecodeAndEncode for Base64SimdWrapper {
117117 Ok ( ( ) )
118118 } else {
119119 Self :: decode_with_no_pad ( input, output)
120- . map_err ( |_| USimpleError :: new ( 1 , "error: invalid input" . to_owned ( ) ) )
120+ . map_err ( |_| USimpleError :: new ( 1 , "error: invalid input" ) )
121121 } ;
122122
123123 if let Err ( err) = decode_result {
@@ -295,7 +295,7 @@ impl SupportsFastDecodeAndEncode for Base58Wrapper {
295295 let digit = alphabet
296296 . iter ( )
297297 . position ( |& b| b == byte)
298- . ok_or_else ( || USimpleError :: new ( 1 , "error: invalid input" . to_owned ( ) ) ) ?;
298+ . ok_or_else ( || USimpleError :: new ( 1 , "error: invalid input" ) ) ?;
299299
300300 // Multiply by 58 and add digit
301301 let mut carry = digit as u32 ;
@@ -426,13 +426,13 @@ impl SupportsFastDecodeAndEncode for Z85Wrapper {
426426
427427 fn decode_into_vec ( & self , input : & [ u8 ] , output : & mut Vec < u8 > ) -> UResult < ( ) > {
428428 if input. first ( ) == Some ( & b'#' ) {
429- return Err ( USimpleError :: new ( 1 , "error: invalid input" . to_owned ( ) ) ) ;
429+ return Err ( USimpleError :: new ( 1 , "error: invalid input" ) ) ;
430430 }
431431
432432 let decode_result = match z85:: decode ( input) {
433433 Ok ( ve) => ve,
434434 Err ( _de) => {
435- return Err ( USimpleError :: new ( 1 , "error: invalid input" . to_owned ( ) ) ) ;
435+ return Err ( USimpleError :: new ( 1 , "error: invalid input" ) ) ;
436436 }
437437 } ;
438438
@@ -451,7 +451,7 @@ impl SupportsFastDecodeAndEncode for Z85Wrapper {
451451 if !input. len ( ) . is_multiple_of ( 4 ) {
452452 return Err ( USimpleError :: new (
453453 1 ,
454- "error: invalid input (length must be multiple of 4 characters)" . to_owned ( ) ,
454+ "error: invalid input (length must be multiple of 4 characters)" ,
455455 ) ) ;
456456 }
457457
@@ -477,7 +477,7 @@ impl SupportsFastDecodeAndEncode for EncodingWrapper {
477477 let decode_len_result = match self . encoding . decode_len ( input. len ( ) ) {
478478 Ok ( us) => us,
479479 Err ( _de) => {
480- return Err ( USimpleError :: new ( 1 , "error: invalid input" . to_owned ( ) ) ) ;
480+ return Err ( USimpleError :: new ( 1 , "error: invalid input" ) ) ;
481481 }
482482 } ;
483483
@@ -493,7 +493,7 @@ impl SupportsFastDecodeAndEncode for EncodingWrapper {
493493 output. truncate ( output_len + us) ;
494494 }
495495 Err ( _de) => {
496- return Err ( USimpleError :: new ( 1 , "error: invalid input" . to_owned ( ) ) ) ;
496+ return Err ( USimpleError :: new ( 1 , "error: invalid input" ) ) ;
497497 }
498498 }
499499
0 commit comments