Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
ccbrown committed Sep 20, 2024
1 parent 6e32a3b commit 27ad5ef
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions packages/iocraft-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ impl ToTokens for ParsedComponent {
});

tokens.extend(quote! {
#vis struct #name {}
#vis struct #name;

impl #name {
fn implementation #generics (#args) #output #block
Expand All @@ -466,17 +466,15 @@ impl ToTokens for ParsedComponent {
type Props<'a> = #props_type_name;

fn new(_props: &Self::Props<'_>) -> Self {
Self {}
Self
}

fn update(&mut self, props: &mut Self::Props<'_>, hooks: ::iocraft::Hooks, updater: &mut ::iocraft::ComponentUpdater) {
{
let mut e = {
#context_refs
Self::implementation(#(#impl_args),*).into()
};
updater.update_children([&mut e], None);
}
let mut e = {
#context_refs
Self::implementation(#(#impl_args),*).into()
};
updater.update_children([&mut e], None);
}
}
});
Expand Down

0 comments on commit 27ad5ef

Please sign in to comment.