@@ -37,7 +37,7 @@ pub fn as_bytes(input: &RadonString, args: &Option<Vec<Value>>) -> Result<RadonB
3737 let wrong_args = || RadError :: WrongArguments {
3838 input_type : RadonString :: radon_type_name ( ) ,
3939 operator : "AsBytes" . to_string ( ) ,
40- args : args. to_owned ( ) . unwrap_or ( Vec :: < Value > :: default ( ) ) . to_vec ( ) ,
40+ args : args. to_owned ( ) . unwrap_or_default ( ) . to_vec ( ) ,
4141 } ;
4242 let mut input_string = input. value ( ) ;
4343 if input_string. starts_with ( "0x" ) {
@@ -49,7 +49,7 @@ pub fn as_bytes(input: &RadonString, args: &Option<Vec<Value>>) -> Result<RadonB
4949 let mut bytes_encoding = RadonBytesEncoding :: Hex ;
5050 match args {
5151 Some ( args) => {
52- if args. len ( ) > 0 {
52+ if ! args. is_empty ( ) {
5353 let arg = args. first ( ) . ok_or_else ( wrong_args) ?. to_owned ( ) ;
5454 let bytes_encoding_u8 = from_value :: < u8 > ( arg) . map_err ( |_| wrong_args ( ) ) ?;
5555 bytes_encoding = RadonBytesEncoding :: try_from ( bytes_encoding_u8) . map_err ( |_| wrong_args ( ) ) ?;
@@ -203,7 +203,7 @@ pub fn parse_json_array(input: &RadonString, args: &Option<Vec<Value>>) -> Resul
203203 description : err. to_string ( ) ,
204204 } ) ?;
205205 let mut subitems: Vec < RadonTypes > = selector. find ( & json_input)
206- . map ( |item| into_radon_types ( item ) )
206+ . map ( into_radon_types)
207207 . collect ( ) ;
208208 if subitems. len ( ) > 1 {
209209 items. insert ( items. len ( ) , RadonArray :: from ( subitems) . into ( ) ) ;
@@ -222,7 +222,7 @@ pub fn parse_json_array(input: &RadonString, args: &Option<Vec<Value>>) -> Resul
222222 description : err. to_string ( ) ,
223223 } ) ?;
224224 let items: Vec < RadonTypes > = selector. find ( & json_input)
225- . map ( |item| into_radon_types ( item ) )
225+ . map ( into_radon_types)
226226 . collect ( ) ;
227227 Ok ( RadonArray :: from ( items) )
228228 }
@@ -254,7 +254,7 @@ fn into_radon_types(value: &serde_json::Value) -> RadonTypes {
254254 serde_json:: Value :: Array ( values) => {
255255 let items: Vec < RadonTypes > = values
256256 . iter ( )
257- . map ( |item| into_radon_types ( item ) )
257+ . map ( into_radon_types)
258258 . collect ( ) ;
259259 RadonTypes :: from ( RadonArray :: from ( items) )
260260 }
0 commit comments