Skip to content

Commit

Permalink
oops + clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
gbj committed Dec 25, 2023
1 parent decf0e2 commit 31bfb9b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions leptos_macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ pub fn component(args: proc_macro::TokenStream, s: TokenStream) -> TokenStream {
};

let Ok(mut dummy) = syn::parse::<DummyModel>(s.clone()) else {
return s.into();
return s;
};
let parse_result = syn::parse::<component::Model>(s);

Expand Down Expand Up @@ -703,11 +703,11 @@ pub fn component(args: proc_macro::TokenStream, s: TokenStream) -> TokenStream {
#[proc_macro_attribute]
pub fn island(_args: proc_macro::TokenStream, s: TokenStream) -> TokenStream {
let Ok(mut dummy) = syn::parse::<DummyModel>(s.clone()) else {
return s.into();
return s;
};
let parse_result = syn::parse::<component::Model>(s);

if let (Ok(ref mut unexpanded), Ok(model)) = (&mut dummy, parse_result) {
if let (ref mut unexpanded, Ok(model)) = (&mut dummy, parse_result) {
let expanded = model.is_island().into_token_stream();
if !matches!(unexpanded.vis, Visibility::Public(_)) {
unexpanded.vis = Visibility::Public(Pub {
Expand All @@ -722,15 +722,13 @@ pub fn island(_args: proc_macro::TokenStream, s: TokenStream) -> TokenStream {
#[allow(non_snake_case, dead_code, clippy::too_many_arguments)]
#unexpanded
}
} else if let Ok(mut dummy) = dummy {
} else {
dummy.sig.ident = unmodified_fn_name_from_fn_name(&dummy.sig.ident);
quote! {
#[doc(hidden)]
#[allow(non_snake_case, dead_code, clippy::too_many_arguments)]
#dummy
}
} else {
s.into()
}
.into()
}
Expand Down

0 comments on commit 31bfb9b

Please sign in to comment.