Skip to content

Commit

Permalink
former : experimenting
Browse files Browse the repository at this point in the history
  • Loading branch information
Wandalen committed Apr 13, 2024
1 parent 00e07f5 commit df6f593
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions module/core/former/tests/inc/former_tests/string_slice_manual.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ pub type Struct1FormerWithClosure< 'a, Context, Formed > =

pub struct Struct1FormerStorage< 'a >
{

pub string_slice_1 : ::core::option::Option< &'a str >,
}

Expand All @@ -92,6 +91,7 @@ impl< 'a > former::Storage for Struct1FormerStorage< 'a >
{
type Formed = Struct1< 'a >;
}

// impl<'a> former::StoragePreform for Struct1FormerStorage<'a> {
// fn preform(mut self) -> Self::Formed {
// let string_slice_1 = self.string_slice_1.take().unwrap_or_else(|| {
Expand All @@ -103,7 +103,8 @@ impl< 'a > former::Storage for Struct1FormerStorage< 'a >

impl< 'a > former::StoragePreform for Struct1FormerStorage< 'a >
{
fn preform( mut self ) -> < Self as former::Storage >::Formed
// fn preform( mut self ) -> < Self as former::Storage >::Formed
fn preform( mut self ) -> Struct1< 'a >
{
let string_slice_1 = if self.string_slice_1.is_some()
{
Expand Down Expand Up @@ -239,17 +240,25 @@ where
}
}

// impl< 'a, Definition > Struct1Former< 'a, Definition >
// where
// Definition : former::FormerDefinition,
// Definition::Types : former::FormerDefinitionTypes< Storage = Struct1FormerStorage< 'a >, Formed = Struct1< 'a > >,
// < Definition::Types as former::FormerDefinitionTypes >::Storage : former::StoragePreform,
// {
// pub fn preform( self ) -> < Definition::Types as former::FormerDefinitionTypes >::Formed
// {
// former::StoragePreform::preform( self.storage )
// }
// }
// pub struct Struct1Former< 'a, Context, Formed, End, Definition = Struct1FormerDefinition< 'a, Context, Formed, End > >
impl< 'a, Context, End, Definition > Struct1Former< 'a, Context, Struct1< 'a >, End, Definition >
where

End : former::FormingEnd::< Definition::Types >,
Definition : former::FormerDefinition< End = End >,
Definition::Types : former::FormerDefinitionTypes< Storage = Struct1FormerStorage< 'a >, Formed = Struct1< 'a >, Context = Context >,

// Definition : former::FormerDefinition,
// Definition::Types : former::FormerDefinitionTypes< Storage = Struct1FormerStorage< 'a >, Formed = Struct1< 'a > >,
< Definition::Types as former::FormerDefinitionTypes >::Storage : former::StoragePreform,
< Definition::Types as former::FormerDefinitionTypes >::Storage : former::Storage< Formed = Struct1< 'a > >,
{
pub fn preform( self ) -> < Definition::Types as former::FormerDefinitionTypes >::Formed
{
// panic!();
former::StoragePreform::preform( self.storage )
}
}

// impl< 'a > former::Storage for Struct1FormerStorage< 'a >
// {
Expand Down

0 comments on commit df6f593

Please sign in to comment.