Skip to content

Commit

Permalink
former : cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
Wandalen committed May 11, 2024
1 parent 57f9f99 commit 21829bb
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
1 change: 1 addition & 0 deletions module/core/former_meta/src/derive_former.rs
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@ specific needs of the broader forming context. It mandates the implementation of
#former_generics_where
{

/// Executes the transformation from the former's storage state to the preformed object as specified by the definition.
pub fn preform( self ) -> < Definition::Types as former::FormerDefinitionTypes >::Formed
{
former::StoragePreform::preform( self.storage )
Expand Down
17 changes: 16 additions & 1 deletion module/core/former_meta/src/derive_former/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,10 +488,26 @@ allowing for dynamic and flexible construction of the `{stru}` entity's {field_i

let setters_code = if attr.setter()
{

let doc = format!
(
r#"
Provides a user-friendly interface to add an instancce of {field_ident} to the {stru}.
# Returns
Returns an instance of `Former2`, a subformer ready to begin the formation process for `{0}` entities,
allowing for dynamic and flexible construction of the `{stru}` entity's {field_ident}.
"#,
format!( "{}", qt!{ #field_typ } ),
);

qt!
{
#setters_code

#[ doc = #doc ]
#[ inline( always ) ]
pub fn #setter_name( self ) ->
< < #field_typ as former::Container >::Val as former::EntityToFormer
Expand Down Expand Up @@ -908,7 +924,6 @@ with the new content generated during the subforming process.
}
else
{

qt!
{
<
Expand Down
3 changes: 2 additions & 1 deletion module/move/wca/src/ca/aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ pub( crate ) mod private
#[ derive( former::Former ) ]
#[ storage_fields( help_generator : HelpGeneratorFn, help_variants : HashSet< HelpVariants > ) ]
#[ mutator( custom = true ) ]
// #[ debug ]
pub struct CommandsAggregator
{
#[ former( default = Dictionary::default() ) ]
Expand All @@ -119,7 +120,7 @@ pub( crate ) mod private

callback_fn : Option< CommandsAggregatorCallback >,
}

impl< Context, Formed > former::FormerMutator for CommandsAggregatorFormerDefinitionTypes< Context, Formed >
{
fn form_mutation( storage : &mut Self::Storage, _context : &mut Option< Self::Context > )
Expand Down
5 changes: 3 additions & 2 deletions module/move/wca/src/ca/grammar/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub( crate ) mod private
/// subject optional parameter
#[ former( default = false ) ]
optional : bool,
#[ scalar( setter = false, hint = false ) ]
#[ scalar( setter = false ) ]
#[ former( default = Vec::new() ) ]
properties_aliases : Vec< String >,
}
Expand Down Expand Up @@ -86,6 +86,7 @@ pub( crate ) mod private

#[ derive( Debug, Clone, PartialEq, Eq ) ]
#[ derive( Former ) ]
// #[ debug ]
pub struct Command
{
/// Command common hint.
Expand All @@ -106,7 +107,7 @@ pub( crate ) mod private
// aaa : here it is
// qqq : make it usable and remove default(?)
/// The type `Routine` represents the specific implementation of the routine.
#[ scalar( setter = false, hint = false ) ]
#[ scalar( setter = false ) ]
#[ former( default = Routine::from( Handler::from( || { panic!( "No routine available: A handler function for the command is missing" ) } ) ) ) ]
pub routine : Routine,
}
Expand Down

0 comments on commit 21829bb

Please sign in to comment.