Skip to content

Commit

Permalink
Remove unnecessary parentheses
Browse files Browse the repository at this point in the history
  • Loading branch information
syyyr committed Jul 9, 2024
1 parent c274b2e commit 155ab83
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions libshvproto-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,17 +162,17 @@ pub fn derive_from_rpcvalue(item: TokenStream) -> TokenStream {
let deref_code = quote!((*x));
let unbox_code = quote!((x.as_ref().clone()));

add_type_matcher(is_type(source_variant_type, "i64"), quote!{Int(x)}, (deref_code).clone());
add_type_matcher(is_type(source_variant_type, "u64"), quote!{UInt(x)}, (deref_code).clone());
add_type_matcher(is_type(source_variant_type, "f64"), quote!{Double(x)}, (deref_code).clone());
add_type_matcher(is_type(source_variant_type, "bool"), quote!{Bool(x)}, (deref_code).clone());
add_type_matcher(is_type(source_variant_type, "DateTime"), quote!{DateTime(x)}, (deref_code).clone());
add_type_matcher(is_type(source_variant_type, "Decimal"), quote!{Decimal(x)}, (deref_code).clone());
add_type_matcher(is_type(source_variant_type, "String"), quote!{String(x)}, (unbox_code).clone());
add_type_matcher(is_type(source_variant_type, "Blob"), quote!{Blob(x)}, (unbox_code).clone());
add_type_matcher(is_type(source_variant_type, "List"), quote!{List(x)}, (unbox_code).clone());
add_type_matcher(is_type(source_variant_type, "Map"), quote!{Map(x)}, (unbox_code).clone());
add_type_matcher(is_type(source_variant_type, "IMap"), quote!{IMap(x)}, (unbox_code).clone());
add_type_matcher(is_type(source_variant_type, "i64"), quote!{Int(x)}, deref_code.clone());
add_type_matcher(is_type(source_variant_type, "u64"), quote!{UInt(x)}, deref_code.clone());
add_type_matcher(is_type(source_variant_type, "f64"), quote!{Double(x)}, deref_code.clone());
add_type_matcher(is_type(source_variant_type, "bool"), quote!{Bool(x)}, deref_code.clone());
add_type_matcher(is_type(source_variant_type, "DateTime"), quote!{DateTime(x)}, deref_code.clone());
add_type_matcher(is_type(source_variant_type, "Decimal"), quote!{Decimal(x)}, deref_code.clone());
add_type_matcher(is_type(source_variant_type, "String"), quote!{String(x)}, unbox_code.clone());
add_type_matcher(is_type(source_variant_type, "Blob"), quote!{Blob(x)}, unbox_code.clone());
add_type_matcher(is_type(source_variant_type, "List"), quote!{List(x)}, unbox_code.clone());
add_type_matcher(is_type(source_variant_type, "Map"), quote!{Map(x)}, unbox_code.clone());
add_type_matcher(is_type(source_variant_type, "IMap"), quote!{IMap(x)}, unbox_code.clone());
}
if let syn::Fields::Unit = &variant.fields {
match_arms_ser.extend(quote!{
Expand Down

0 comments on commit 155ab83

Please sign in to comment.