From 130812296893e39587cf4f704c8a4f1998948544 Mon Sep 17 00:00:00 2001 From: wandalen Date: Sat, 30 Mar 2024 16:52:27 +0200 Subject: [PATCH] former : experimenting --- .../inc/former_tests/a_primitives_manual.rs | 35 ++----------------- .../inc/former_tests/only_test/primitives.rs | 24 ++++++------- 2 files changed, 15 insertions(+), 44 deletions(-) diff --git a/module/core/former/tests/inc/former_tests/a_primitives_manual.rs b/module/core/former/tests/inc/former_tests/a_primitives_manual.rs index fa99e0cf9f..25351e9bed 100644 --- a/module/core/former/tests/inc/former_tests/a_primitives_manual.rs +++ b/module/core/former/tests/inc/former_tests/a_primitives_manual.rs @@ -201,28 +201,6 @@ where return result; } - // #[ inline( always ) ] - // pub fn begin_with< IntoEnd > - // ( - // mut storage : core::option::Option< < Definition::Types as former::FormerDefinitionTypes >::Storage >, - // context : core::option::Option< < Definition::Types as former::FormerDefinitionTypes >::Context >, - // on_end : IntoEnd, - // ) -> Self - // where - // IntoEnd : ::core::convert::Into< < Definition as former::FormerDefinition >::End > - // { - // if storage.is_none() - // { - // storage = Some( core::default::Default::default() ); - // } - // Self - // { - // storage : storage.unwrap(), - // context, - // on_end : ::core::option::Option::Some( on_end.into() ), - // } - // } - #[ inline( always ) ] pub fn begin< IntoEnd > ( @@ -246,7 +224,7 @@ where } #[ inline( always ) ] - pub fn begin_precise + pub fn _begin_precise ( mut storage : core::option::Option< < Definition::Types as former::FormerDefinitionTypes >::Storage >, context : core::option::Option< < Definition::Types as former::FormerDefinitionTypes >::Context >, @@ -306,18 +284,11 @@ where // zzz : update description #[ inline( always ) ] - pub fn new_precise( on_end : Definition::End ) -> Self + pub fn _new_precise( on_end : Definition::End ) -> Self { - Self::begin_precise( None, None, on_end ) + Self::_begin_precise( None, None, on_end ) } - // #[ inline( always ) ] - // pub fn new( on_end : Definition::End ) -> Self - // { - // Self::begin_precise( None, None, on_end ) - // } - - // zzz : use #[ inline( always ) ] pub fn new< IntoEnd >( end : IntoEnd ) -> Self where diff --git a/module/core/former/tests/inc/former_tests/only_test/primitives.rs b/module/core/former/tests/inc/former_tests/only_test/primitives.rs index d851a52976..8731712fbb 100644 --- a/module/core/former/tests/inc/former_tests/only_test/primitives.rs +++ b/module/core/former/tests/inc/former_tests/only_test/primitives.rs @@ -125,13 +125,13 @@ tests_impls! // - fn begin_precise() + fn _begin_precise() { // custom params let got = Struct1Former ::< Struct1FormerDefinition< i32, i32, _ > > - ::begin_precise + ::_begin_precise ( None, Some( 3 ), @@ -147,7 +147,7 @@ tests_impls! // custom params with into let got = Struct1Former ::< Struct1FormerDefinition< i32, i32, former::FormingEndWrapper< Struct1FormerDefinitionTypes< i32, i32 > > > > - ::begin_precise + ::_begin_precise ( None, Some( 3 ), @@ -168,7 +168,7 @@ tests_impls! // basic case let former = Struct1::former(); - let former2 = Struct1Former::< Struct1FormerDefinition >::new_precise( former::ReturnPreformed ); + let former2 = Struct1Former::< Struct1FormerDefinition >::_new_precise( former::ReturnPreformed ); a_id!( std::mem::size_of_val( &former ), std::mem::size_of_val( &former2 ) ); let exp = former.form(); let got = former2.form(); @@ -219,12 +219,12 @@ tests_impls! // - fn new_precise() + fn _new_precise() { // basic case let former = Struct1::former(); - let former2 = Struct1Former::< Struct1FormerDefinition >::new_precise( former::ReturnPreformed ); + let former2 = Struct1Former::< Struct1FormerDefinition >::_new_precise( former::ReturnPreformed ); a_id!( std::mem::size_of_val( &former ), std::mem::size_of_val( &former2 ) ); let exp = former.form(); let got = former2.form(); @@ -233,7 +233,7 @@ tests_impls! // default explicit params let got = Struct1Former ::< Struct1FormerDefinition< (), Struct1, _ > > - ::new_precise( former::ReturnPreformed ) + ::_new_precise( former::ReturnPreformed ) .int_1( 13 ) .form(); let exp = Struct1::former().int_1( 13 ).form(); @@ -247,7 +247,7 @@ tests_impls! let end_wrapper : former::FormingEndWrapper< Struct1FormerDefinitionTypes< (), Struct1 > > = former::FormingEndWrapper::new( f1 ); let got = Struct1Former ::< Struct1FormerDefinition< (), Struct1, _ > > - ::new_precise( end_wrapper ) + ::_new_precise( end_wrapper ) .int_1( 13 ) .form(); let exp = Struct1::former().int_1( 13 ).form(); @@ -256,7 +256,7 @@ tests_impls! // default explicit params with wrapper and closure let got = Struct1Former ::< Struct1FormerDefinition< (), Struct1, _ > > - ::new_precise( former::FormingEndWrapper::new( | storage, _context | { former::StoragePreform::preform( storage ) } ) ) + ::_new_precise( former::FormingEndWrapper::new( | storage, _context | { former::StoragePreform::preform( storage ) } ) ) .int_1( 13 ) .form(); let exp = Struct1::former().int_1( 13 ).form(); @@ -265,7 +265,7 @@ tests_impls! // default explicit params with wrapper and closure, auto types let got = Struct1Former ::< Struct1FormerDefinition< _, _, _ > > - ::new_precise( former::FormingEndWrapper::new( | storage, _context : Option< () > | { former::StoragePreform::preform( storage ) } ) ) + ::_new_precise( former::FormingEndWrapper::new( | storage, _context : Option< () > | { former::StoragePreform::preform( storage ) } ) ) .int_1( 13 ) .form(); let exp = Struct1::former().int_1( 13 ).form(); @@ -541,9 +541,9 @@ tests_index! { internals, begin, - begin_precise, + _begin_precise, new, - new_precise, + _new_precise, custom_definition_params, preform, definition,