Skip to content

Commit

Permalink
former : experimenting
Browse files Browse the repository at this point in the history
  • Loading branch information
Wandalen committed Apr 30, 2024
1 parent dffbd69 commit 977f9a6
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 21 deletions.
1 change: 0 additions & 1 deletion module/core/former/src/vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ for Vec< E >
type Storage = Vec< E >;
}

// xxx : implement for other containers
impl< E, Context, Formed, End > crate::EntityToDefinition< Context, Formed, End >
for Vec< E >
where
Expand Down
8 changes: 8 additions & 0 deletions module/core/former/tests/inc/former_tests/a_basic_manual.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ impl former::EntityToStorage for Struct1
type Storage = Struct1FormerStorage;
}

impl< Context, Formed, End > former::EntityToDefinition< Context, Formed, End >
for Struct1
where
End : former::FormingEnd< Struct1FormerDefinitionTypes< Context, Formed > >,
{
type Definition = Struct1FormerDefinition< Context, Formed, End >;
}

// = definition types

#[ derive( Debug ) ]
Expand Down
18 changes: 17 additions & 1 deletion module/core/former/tests/inc/former_tests/only_test/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,23 @@ tests_impls!
a_id!( got, exp );

let got = < Struct1 as former::EntityToStorage >::Storage::default();
let exp = < Struct1 as former::EntityToFormer< Struct1FormerDefinition< (), Struct1, former::ReturnPreformed > > >::Former::new_precise( former::ReturnPreformed );
let exp =
<
Struct1 as former::EntityToFormer
<
Struct1FormerDefinition< (), Struct1, former::ReturnPreformed >
>
>::Former::new_precise( former::ReturnPreformed );
a_id!( got.int_1, exp.storage.int_1 );

let got = < Struct1 as former::EntityToStorage >::Storage::default();
let exp =
<
Struct1 as former::EntityToFormer
<
< Struct1 as former::EntityToDefinition< (), Struct1, former::ReturnPreformed > >::Definition
>
>::Former::new_precise( former::ReturnPreformed );
a_id!( got.int_1, exp.storage.int_1 );

}
Expand Down
19 changes: 0 additions & 19 deletions module/core/former_meta/src/derive/former.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1617,16 +1617,6 @@ pub fn former( input : proc_macro::TokenStream ) -> Result< TokenStream >

// = entity to former

// impl< #struct_generics_impl > former::EntityToFormer_
// for #stru < #struct_generics_ty >
// where
// Self : Sized,
// #struct_generics_where
// {
// type Storage = #former_storage < #struct_generics_ty >;
// type Former = #former < #struct_generics_ty >;
// }

impl< #struct_generics_impl Definition > former::EntityToFormer< Definition >
for #stru < #struct_generics_ty >
where
Expand All @@ -1653,15 +1643,6 @@ pub fn former( input : proc_macro::TokenStream ) -> Result< TokenStream >
type Definition = #former_definition < #struct_generics_ty __Context, __Formed, __End >;
}

// // xxx : implement for other containers
// impl< E, Context, Formed, End > former::EntityToDefinition< Context, Formed, End >
// for Vec< E >
// where
// End : crate::FormingEnd< VectorDefinition< E, Context, Formed, NoEnd > >,
// {
// type Definition = VectorDefinition< E, Context, Formed, End >;
// }

// = definition types

#[ derive( Debug ) ]
Expand Down

0 comments on commit 977f9a6

Please sign in to comment.