Skip to content

Commit

Permalink
cgp_auto_getter macro is now working
Browse files Browse the repository at this point in the history
  • Loading branch information
soareschen committed Jan 8, 2025
1 parent c3ec1e4 commit bda46a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ pub fn derive_blanket_impl(
});

methods.extend(quote! {
fn #field_name( context: & #context_type ) -> & #provider_type {
context.get_field( ::core::marker::PhantomData::< #field_symbol > )
fn #field_name( &self ) -> & #provider_type {
self.get_field( ::core::marker::PhantomData::< #field_symbol > )
}
});
} else {
Expand All @@ -38,8 +38,8 @@ pub fn derive_blanket_impl(
});

methods.extend(quote! {
fn #field_name( context: &mut #context_type ) -> &mut #provider_type {
context.get_field_mut( ::core::marker::PhantomData::< #field_symbol > )
fn #field_name( &mut self ) -> &mut #provider_type {
self.get_field_mut( ::core::marker::PhantomData::< #field_symbol > )
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions crates/cgp-core/src/prelude.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pub use cgp_async::{async_trait, Async, MaybeSend, MaybeStatic, MaybeSync};
pub use cgp_component::{DelegateComponent, HasComponents, UseFields, WithContext, WithProvider};
pub use cgp_component_macro::{
cgp_component, cgp_getter, cgp_preset, cgp_type, delegate_components, for_each_replace,
replace_with,
cgp_auto_getter, cgp_component, cgp_getter, cgp_preset, cgp_type, delegate_components,
for_each_replace, replace_with,
};
pub use cgp_error::{CanRaiseError, CanWrapError, HasErrorType};
pub use cgp_field::{
Expand Down

0 comments on commit bda46a9

Please sign in to comment.