Skip to content

Commit

Permalink
experimenting
Browse files Browse the repository at this point in the history
  • Loading branch information
Wandalen committed Mar 26, 2024
1 parent 71394ff commit 71d1473
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
2 changes: 1 addition & 1 deletion module/core/former/src/axiomatic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ where
// }
// }

/// xxx
/// xxx : update description
#[ derive( Debug, Default ) ]
pub struct ReturnStorage;

Expand Down
19 changes: 15 additions & 4 deletions module/core/former/src/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ where
#[ derive( Default ) ]
pub struct ContainerSubformer< E, Definition >
where
// End : FormingEnd< Definition >,
Definition : FormerDefinition,
< Definition::Types as FormerDefinitionTypes >::Storage : ContainerAdd< Element = E >,
{
Expand All @@ -208,7 +207,6 @@ where

impl< E, Definition > ContainerSubformer< E, Definition >
where
// End : FormingEnd< Definition >,
Definition : FormerDefinition,
< Definition::Types as FormerDefinitionTypes >::Storage : ContainerAdd< Element = E >,
{
Expand Down Expand Up @@ -314,6 +312,7 @@ where
/// # Returns
/// A new instance of `ContainerSubformer` with an empty internal formed.
///
// xxx : update description
#[ inline( always ) ]
pub fn new( end : Definition::End ) -> Self
{
Expand All @@ -325,11 +324,24 @@ where
)
}

// xxx : update description
#[ inline( always ) ]
pub fn new_with< IntoEnd >( end : IntoEnd ) -> Self
where
IntoEnd : Into< Definition::End >,
{
Self::begin
(
None,
None,
end.into(),
)
}

}

impl< E, Definition > ContainerSubformer< E, Definition >
where
// End : FormingEnd< Definition >,
Definition : FormerDefinition,
< Definition::Types as FormerDefinitionTypes >::Storage : ContainerAdd< Element = E >,
{
Expand Down Expand Up @@ -358,7 +370,6 @@ where
impl< E, Definition > FormerBegin< Definition >
for ContainerSubformer< E, Definition >
where
// End : FormingEnd< Definition >,
Definition : FormerDefinition,
< Definition::Types as FormerDefinitionTypes >::Storage : ContainerAdd< Element = E >,
{
Expand Down
2 changes: 1 addition & 1 deletion module/core/former/src/vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl< E > VecExt< E > for Vec< E >
{
fn former() -> VectorSubformer< E, (), Vec< E >, ReturnStorage >
{
VectorSubformer::< E, (), Vec< E >, ReturnStorage >::new( Default::default() )
VectorSubformer::< E, (), Vec< E >, ReturnStorage >::new( ReturnStorage::default() )
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,13 @@ fn custom_definition_custom_end()
let exp = 13;
a_id!( got, exp );

let got = the_module::ContainerSubformer::< String, Return13 >::new_with( return_13 )
.push( "a" )
.push( "b" )
.form();
let exp = 13;
a_id!( got, exp );

//

}
Expand Down

0 comments on commit 71d1473

Please sign in to comment.