Skip to content

Commit

Permalink
[macros] Minor fixes as per clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
bal-e committed Jan 2, 2025
1 parent 4a5d343 commit d1f94ba
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub fn derive_split_bytes(input: pm::TokenStream) -> pm::TokenStream {
skeleton.bound = Some(
parse_quote!(::domain::new_base::parse::SplitBytes<#lifetime>),
);
if skeleton.lifetimes.len() > 0 {
if !skeleton.lifetimes.is_empty() {
let lifetimes = skeleton.lifetimes.iter();
let param = parse_quote! {
#lifetime: #(#lifetimes)+*
Expand Down Expand Up @@ -105,7 +105,7 @@ pub fn derive_split_bytes(input: pm::TokenStream) -> pm::TokenStream {
}
});

Ok(skeleton.into_token_stream().into())
Ok(skeleton.into_token_stream())
}

let input = syn::parse_macro_input!(input as DeriveInput);
Expand Down Expand Up @@ -175,7 +175,7 @@ pub fn derive_parse_bytes(input: pm::TokenStream) -> pm::TokenStream {
skeleton.bound = Some(
parse_quote!(::domain::new_base::parse::ParseBytes<#lifetime>),
);
if skeleton.lifetimes.len() > 0 {
if !skeleton.lifetimes.is_empty() {
let lifetimes = skeleton.lifetimes.iter();
let param = parse_quote! {
#lifetime: #(#lifetimes)+*
Expand Down Expand Up @@ -252,7 +252,7 @@ pub fn derive_parse_bytes(input: pm::TokenStream) -> pm::TokenStream {
}
});

Ok(skeleton.into_token_stream().into())
Ok(skeleton.into_token_stream())
}

let input = syn::parse_macro_input!(input as DeriveInput);
Expand Down Expand Up @@ -360,7 +360,7 @@ pub fn derive_split_bytes_by_ref(input: pm::TokenStream) -> pm::TokenStream {
}
});

Ok(skeleton.into_token_stream().into())
Ok(skeleton.into_token_stream())
}

let input = syn::parse_macro_input!(input as DeriveInput);
Expand Down Expand Up @@ -501,7 +501,7 @@ pub fn derive_parse_bytes_by_ref(input: pm::TokenStream) -> pm::TokenStream {
}
});

Ok(skeleton.into_token_stream().into())
Ok(skeleton.into_token_stream())
}

let input = syn::parse_macro_input!(input as DeriveInput);
Expand Down Expand Up @@ -564,7 +564,7 @@ pub fn derive_build_bytes(input: pm::TokenStream) -> pm::TokenStream {
}
});

Ok(skeleton.into_token_stream().into())
Ok(skeleton.into_token_stream())
}

let input = syn::parse_macro_input!(input as DeriveInput);
Expand Down Expand Up @@ -611,7 +611,7 @@ pub fn derive_as_bytes(input: pm::TokenStream) -> pm::TokenStream {

// The default implementation of 'as_bytes()' works perfectly.

Ok(skeleton.into_token_stream().into())
Ok(skeleton.into_token_stream())
}

let input = syn::parse_macro_input!(input as DeriveInput);
Expand Down

0 comments on commit d1f94ba

Please sign in to comment.