Skip to content

Commit

Permalink
experimenting
Browse files Browse the repository at this point in the history
  • Loading branch information
Wandalen committed Mar 28, 2024
1 parent 8790e5f commit 27c8f4a
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions module/core/former/tests/inc/former_tests/a_primitives_manual.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub struct Struct1
// generated by former
impl Struct1
{
pub fn former() -> Struct1Former< (), former::ReturnFormed >
pub fn former() -> Struct1Former
{
Struct1Former::new()
}
Expand All @@ -40,14 +40,14 @@ for Struct1FormerDefinition
type Storage = Struct1FormerStorage;
type Formed = Struct1;
type Context = ();
// type End = former::ReturnFormed;
// type End = former::ReturnPreformed;
}

impl former::FormerDefinition
for Struct1FormerDefinition
{
type Types = Struct1FormerDefinition;
type End = former::ReturnFormed;
type End = former::ReturnPreformed;
}

// = storage
Expand Down Expand Up @@ -148,20 +148,20 @@ for Struct1FormerStorage

pub struct Struct1Former
<
FormerContext = Struct1,
FormerEnd = the_module::ReturnFormed,
// FormerContext = Struct1,
// FormerEnd = the_module::ReturnPreformed,
>
where
FormerEnd : the_module::FormingEnd< Struct1FormerDefinition, FormerContext >,
// where
// FormerEnd : the_module::FormingEnd< Struct1FormerDefinition >,
{
storage : Struct1FormerStorage,
context : core::option::Option< FormerContext >,
on_end : core::option::Option< FormerEnd >,
context : core::option::Option< < Struct1FormerDefinition as former::FormerDefinitionTypes >::Context >,
on_end : core::option::Option< < Struct1FormerDefinition as former::FormerDefinition >::End >,
}

impl< FormerContext, FormerEnd > Struct1Former< FormerContext, FormerEnd >
where
FormerEnd: the_module::FormingEnd< Struct1FormerDefinition, FormerContext >,
impl Struct1Former
// where
// FormerEnd: the_module::FormingEnd< Struct1FormerDefinition, FormerContext >,
{

fn preform( self ) -> < Struct1FormerDefinition as former::FormerDefinitionTypes >::Formed
Expand All @@ -180,8 +180,8 @@ where
pub fn begin
(
mut storage : core::option::Option< < Struct1FormerDefinition as former::FormerDefinitionTypes >::Storage >,
context : core::option::Option< FormerContext >,
on_end : FormerEnd,
context : core::option::Option< < Struct1FormerDefinition as former::FormerDefinitionTypes >::Context >,
on_end : < Struct1FormerDefinition as former::FormerDefinition >::End,
// xxx : cover by test existance of these 3 parameters in the function
) -> Self
{
Expand All @@ -202,7 +202,7 @@ where
{
let on_end = self.on_end.take().unwrap();
let context = self.context.take();
on_end.call( self.storage, context )
former::FormingEnd::call( &on_end, self.storage, context )
}

#[ inline( always ) ]
Expand Down Expand Up @@ -237,13 +237,13 @@ where

}

impl Struct1Former< (), the_module::ReturnFormed >
impl Struct1Former
{

#[ inline( always ) ]
pub fn new() -> Struct1Former< (), the_module::ReturnFormed >
pub fn new() -> Struct1Former
{
Struct1Former::< (), the_module::ReturnFormed >::begin( None, None, the_module::ReturnFormed )
Struct1Former::begin( None, None, the_module::ReturnPreformed )
}

}
Expand Down

0 comments on commit 27c8f4a

Please sign in to comment.