From 46e46b3eb54265d6c8d26e427f8b887d8dc44abf Mon Sep 17 00:00:00 2001 From: wandalen Date: Tue, 2 Apr 2024 12:08:45 +0300 Subject: [PATCH] former : experimenting --- .../a_containers_with_subformer.rs | 4 +- .../a_containers_with_subformer_2_manual.rs | 36 ++++---- .../a_containers_with_subformer_manual.rs | 72 ++++++++-------- .../a_containers_without_subformer.rs | 4 +- .../attribute_default_primitive.rs | 8 +- .../tests/inc/former_tests/name_collisions.rs | 4 +- .../only_test/containers_with_subformer.rs | 84 +++++++++---------- .../only_test/containers_without_subformer.rs | 42 +++++----- .../inc/former_tests/only_test/primitives.rs | 2 +- 9 files changed, 128 insertions(+), 128 deletions(-) diff --git a/module/core/former/tests/inc/former_tests/a_containers_with_subformer.rs b/module/core/former/tests/inc/former_tests/a_containers_with_subformer.rs index 53d8f86ad4..5a4c492d11 100644 --- a/module/core/former/tests/inc/former_tests/a_containers_with_subformer.rs +++ b/module/core/former/tests/inc/former_tests/a_containers_with_subformer.rs @@ -11,9 +11,9 @@ pub struct Struct1 #[ subformer( the_module::VectorSubformer ) ] vec_1 : Vec< String >, #[ subformer( the_module::HashMapSubformer ) ] - hashmap_strings_1 : std::collections::HashMap< String, String >, + hashmap_1 : std::collections::HashMap< String, String >, #[ subformer( the_module::HashSetSubformer ) ] - hashset_strings_1 : std::collections::HashSet< String >, + hashset_1 : std::collections::HashSet< String >, } // include!( "./only_test/containers_with_subformer.rs" ); diff --git a/module/core/former/tests/inc/former_tests/a_containers_with_subformer_2_manual.rs b/module/core/former/tests/inc/former_tests/a_containers_with_subformer_2_manual.rs index b080a71ca2..3332a2f999 100644 --- a/module/core/former/tests/inc/former_tests/a_containers_with_subformer_2_manual.rs +++ b/module/core/former/tests/inc/former_tests/a_containers_with_subformer_2_manual.rs @@ -7,8 +7,8 @@ use super::*; pub struct Struct1 { vec_1 : Vec< String >, - hashmap_strings_1 : std::collections::HashMap< String, String >, - hashset_strings_1 : std::collections::HashSet< String >, + hashmap_1 : std::collections::HashMap< String, String >, + hashset_1 : std::collections::HashSet< String >, } // = formed @@ -27,8 +27,8 @@ impl Struct1 pub struct Struct1FormerStorage { pub vec_1 : ::core::option::Option< Vec< String > >, - pub hashmap_strings_1 : ::core::option::Option< std::collections::HashMap< String, String > >, - pub hashset_strings_1 : ::core::option::Option< std::collections::HashSet< String > >, + pub hashmap_1 : ::core::option::Option< std::collections::HashMap< String, String > >, + pub hashset_1 : ::core::option::Option< std::collections::HashSet< String > >, } impl Default for Struct1FormerStorage @@ -40,8 +40,8 @@ impl Default for Struct1FormerStorage Self { vec_1 : None, - hashmap_strings_1 : None, - hashset_strings_1 : None, + hashmap_1 : None, + hashset_1 : None, } } @@ -81,9 +81,9 @@ where val }; - let hashmap_strings_1 = if self.storage.hashmap_strings_1.is_some() + let hashmap_1 = if self.storage.hashmap_1.is_some() { - self.storage.hashmap_strings_1.take().unwrap() + self.storage.hashmap_1.take().unwrap() } else { @@ -91,9 +91,9 @@ where val }; - let hashset_strings_1 = if self.storage.hashset_strings_1.is_some() + let hashset_1 = if self.storage.hashset_1.is_some() { - self.storage.hashset_strings_1.take().unwrap() + self.storage.hashset_1.take().unwrap() } else { @@ -104,8 +104,8 @@ where Struct1 { vec_1, - hashmap_strings_1, - hashset_strings_1, + hashmap_1, + hashset_1, } } @@ -212,7 +212,7 @@ where // the_module::VectorSubformer::< String, Vec< String >, Self, _ >::begin( Some( self ), formed, on_end ) // } - pub fn hashmap_strings_1( mut self ) -> the_module::HashMapSubformer + pub fn hashmap_1( mut self ) -> the_module::HashMapSubformer < String, String, @@ -221,17 +221,17 @@ where impl the_module::FormingEnd< std::collections::HashMap< String, String >, Self >, > { - let formed = self.storage.hashmap_strings_1.take(); + let formed = self.storage.hashmap_1.take(); let on_end = | formed : std::collections::HashMap< String, String >, super_former : ::core::option::Option< Self > | -> Self { let mut super_former = super_former.unwrap(); - super_former.storage.hashmap_strings_1 = Some( formed ); + super_former.storage.hashmap_1 = Some( formed ); super_former }; the_module::HashMapSubformer::begin( formed, Some( self ), on_end ) } - pub fn hashset_strings_1( mut self ) -> the_module::HashSetSubformer + pub fn hashset_1( mut self ) -> the_module::HashSetSubformer < String, std::collections::HashSet< String >, @@ -239,11 +239,11 @@ where impl the_module::FormingEnd< std::collections::HashSet< String >, Self >, > { - let formed = self.storage.hashset_strings_1.take(); + let formed = self.storage.hashset_1.take(); let on_end = | formed : std::collections::HashSet< String >, super_former : ::core::option::Option< Self > | -> Self { let mut super_former = super_former.unwrap(); - super_former.storage.hashset_strings_1 = Some( formed ); + super_former.storage.hashset_1 = Some( formed ); super_former }; the_module::HashSetSubformer::begin( formed, Some( self ), on_end ) diff --git a/module/core/former/tests/inc/former_tests/a_containers_with_subformer_manual.rs b/module/core/former/tests/inc/former_tests/a_containers_with_subformer_manual.rs index 7fdd798d2b..1959d449b9 100644 --- a/module/core/former/tests/inc/former_tests/a_containers_with_subformer_manual.rs +++ b/module/core/former/tests/inc/former_tests/a_containers_with_subformer_manual.rs @@ -5,8 +5,8 @@ use super::*; pub struct Struct1 { vec_1 : Vec< String >, - hashmap_strings_1 : std::collections::HashMap< String, String >, - hashset_strings_1 : std::collections::HashSet< String >, + hashmap_1 : std::collections::HashMap< String, String >, + hashset_1 : std::collections::HashSet< String >, } // = generated @@ -83,10 +83,10 @@ pub struct Struct1FormerStorage pub vec_1 : ::core::option::Option< Vec< String > >, #[ doc = r" A field" ] - pub hashmap_strings_1 : ::core::option::Option< std::collections::HashMap< String, String > >, + pub hashmap_1 : ::core::option::Option< std::collections::HashMap< String, String > >, #[ doc = r" A field" ] - pub hashset_strings_1 : ::core::option::Option< std::collections::HashSet< String > >, + pub hashset_1 : ::core::option::Option< std::collections::HashSet< String > >, } impl ::core::default::Default for Struct1FormerStorage @@ -97,8 +97,8 @@ impl ::core::default::Default for Struct1FormerStorage Self { vec_1 : ::core::option::Option::None, - hashmap_strings_1 : ::core::option::Option::None, - hashset_strings_1 : ::core::option::Option::None, + hashmap_1 : ::core::option::Option::None, + hashset_1 : ::core::option::Option::None, } } } @@ -138,9 +138,9 @@ impl former::StoragePreform for Struct1FormerStorage ( &::core::marker::PhantomData::< Vec< String > > ).maybe_default() } }; - let hashmap_strings_1 = if self.hashmap_strings_1.is_some() + let hashmap_1 = if self.hashmap_1.is_some() { - self.hashmap_strings_1.take().unwrap() + self.hashmap_1.take().unwrap() } else { @@ -149,7 +149,7 @@ impl former::StoragePreform for Struct1FormerStorage { fn maybe_default( self : &Self ) -> T { - panic!( "Field 'hashmap_strings_1' isn't initialized" ) + panic!( "Field 'hashmap_1' isn't initialized" ) } } impl< T > MaybeDefault< T > for &::core::marker::PhantomData< T > {} @@ -164,9 +164,9 @@ impl former::StoragePreform for Struct1FormerStorage ( &::core::marker::PhantomData::< std::collections::HashMap< String, String > > ).maybe_default() } }; - let hashset_strings_1 = if self.hashset_strings_1.is_some() + let hashset_1 = if self.hashset_1.is_some() { - self.hashset_strings_1.take().unwrap() + self.hashset_1.take().unwrap() } else { @@ -175,7 +175,7 @@ impl former::StoragePreform for Struct1FormerStorage { fn maybe_default( self : &Self ) -> T { - panic!( "Field 'hashset_strings_1' isn't initialized" ) + panic!( "Field 'hashset_1' isn't initialized" ) } } impl< T > MaybeDefault< T > for &::core::marker::PhantomData< T > {} @@ -193,8 +193,8 @@ impl former::StoragePreform for Struct1FormerStorage let result = Struct1 { vec_1, - hashmap_strings_1, - hashset_strings_1, + hashmap_1, + hashset_1, }; return result; } @@ -385,7 +385,7 @@ where // } #[ inline( always ) ] - pub fn hashmap_strings_1_set< Former2 >( self ) -> Former2 + pub fn hashmap_1_set< Former2 >( self ) -> Former2 where Former2 : former::FormerBegin < @@ -395,27 +395,27 @@ where String, Self, Self, - __hashmap_strings_1_end, + __hashmap_1_end, > >, { - Former2::_begin( None, Some( self ), __hashmap_strings_1_end ) + Former2::_begin( None, Some( self ), __hashmap_1_end ) } - pub fn hashmap_strings_1( self ) -> + pub fn hashmap_1( self ) -> former::ContainerSubformer:: < - ( String, String ), former::HashMapDefinition< String, String, Self, Self, __hashmap_strings_1_end > + ( String, String ), former::HashMapDefinition< String, String, Self, Self, __hashmap_1_end > > { - self.hashmap_strings_1_set::< former::ContainerSubformer:: + self.hashmap_1_set::< former::ContainerSubformer:: < - ( String, String ), former::HashMapDefinition< String, String, Self, Self, __hashmap_strings_1_end > + ( String, String ), former::HashMapDefinition< String, String, Self, Self, __hashmap_1_end > >>() } #[ inline( always ) ] - pub fn hashset_strings_1_set< Former2 >( self ) -> Former2 + pub fn hashset_1_set< Former2 >( self ) -> Former2 where Former2 : former::FormerBegin < @@ -424,22 +424,22 @@ where String, Self, Self, - __hashset_strings_1_end, + __hashset_1_end, > >, { - Former2::_begin( None, Some( self ), __hashset_strings_1_end ) + Former2::_begin( None, Some( self ), __hashset_1_end ) } - pub fn hashset_strings_1( self ) -> + pub fn hashset_1( self ) -> former::ContainerSubformer:: < - String, former::HashSetDefinition< String, Self, Self, __hashset_strings_1_end > + String, former::HashSetDefinition< String, Self, Self, __hashset_1_end > > { - self.hashset_strings_1_set::< former::ContainerSubformer:: + self.hashset_1_set::< former::ContainerSubformer:: < - String, former::HashSetDefinition< String, Self, Self, __hashset_strings_1_end > + String, former::HashSetDefinition< String, Self, Self, __hashset_1_end > >>() } @@ -493,13 +493,13 @@ where // zzz : description /// Return original former after subformer for `hashmap_string_1` is done. #[ allow( non_camel_case_types ) ] -pub struct __hashmap_strings_1_end; +pub struct __hashmap_1_end; #[ automatically_derived ] impl< Definition > former::FormingEnd < former::HashMapDefinition< String, String, Struct1Former< Definition >, Struct1Former< Definition >, former::NoEnd >, > -for __hashmap_strings_1_end +for __hashmap_1_end where Definition : former::FormerDefinition, Definition::Types : former::FormerDefinitionTypes @@ -511,13 +511,13 @@ where fn call( &self, storage : std::collections::HashMap< String, String >, super_former : Option< Struct1Former< Definition > > ) -> Struct1Former< Definition > { let mut super_former = super_former.unwrap(); - if let Some( ref mut field ) = super_former.storage.hashmap_strings_1 + if let Some( ref mut field ) = super_former.storage.hashmap_1 { former::ContainerAssign::assign( field, storage ); } else { - super_former.storage.hashmap_strings_1 = Some( storage ); + super_former.storage.hashmap_1 = Some( storage ); } super_former } @@ -526,13 +526,13 @@ where // zzz : description /// Return original former after subformer for `hashset_string_1` is done. #[ allow( non_camel_case_types ) ] -pub struct __hashset_strings_1_end; +pub struct __hashset_1_end; #[ automatically_derived ] impl< Definition > former::FormingEnd < former::HashSetDefinition< String, Struct1Former< Definition >, Struct1Former< Definition >, former::NoEnd >, > -for __hashset_strings_1_end +for __hashset_1_end where Definition : former::FormerDefinition, Definition::Types : former::FormerDefinitionTypes @@ -544,13 +544,13 @@ where fn call( &self, storage : std::collections::HashSet< String >, super_former : Option< Struct1Former< Definition > > ) -> Struct1Former< Definition > { let mut super_former = super_former.unwrap(); - if let Some( ref mut field ) = super_former.storage.hashset_strings_1 + if let Some( ref mut field ) = super_former.storage.hashset_1 { former::ContainerAssign::assign( field, storage ); } else { - super_former.storage.hashset_strings_1 = Some( storage ); + super_former.storage.hashset_1 = Some( storage ); } super_former } diff --git a/module/core/former/tests/inc/former_tests/a_containers_without_subformer.rs b/module/core/former/tests/inc/former_tests/a_containers_without_subformer.rs index 9cd61f41eb..4b09b320a5 100644 --- a/module/core/former/tests/inc/former_tests/a_containers_without_subformer.rs +++ b/module/core/former/tests/inc/former_tests/a_containers_without_subformer.rs @@ -9,8 +9,8 @@ use std::collections::HashSet; pub struct Struct1 { vec_1 : Vec< String >, - hashmap_strings_1 : HashMap< String, String >, - hashset_strings_1 : HashSet< String >, + hashmap_1 : HashMap< String, String >, + hashset_1 : HashSet< String >, } // diff --git a/module/core/former/tests/inc/former_tests/attribute_default_primitive.rs b/module/core/former/tests/inc/former_tests/attribute_default_primitive.rs index e81ac264bf..21538d87c4 100644 --- a/module/core/former/tests/inc/former_tests/attribute_default_primitive.rs +++ b/module/core/former/tests/inc/former_tests/attribute_default_primitive.rs @@ -36,8 +36,8 @@ pub struct Struct1 string_optional_1 : Option< String >, vec_1 : Vec< String >, - hashmap_strings_1 : HashMap< String, String >, - hashset_strings_1 : HashSet< String >, + hashmap_1 : HashMap< String, String >, + hashset_1 : HashSet< String >, } // @@ -55,8 +55,8 @@ tests_impls! int_optional_1 : Some( 31 ), string_optional_1 : Some( "abc".to_string() ), vec_1 : vec![], - hashmap_strings_1 : hmap!{}, - hashset_strings_1 : hset!{}, + hashmap_1 : hmap!{}, + hashset_1 : hset!{}, }; a_id!( command, expected ); } diff --git a/module/core/former/tests/inc/former_tests/name_collisions.rs b/module/core/former/tests/inc/former_tests/name_collisions.rs index 6b318a809e..843af61803 100644 --- a/module/core/former/tests/inc/former_tests/name_collisions.rs +++ b/module/core/former/tests/inc/former_tests/name_collisions.rs @@ -28,8 +28,8 @@ type HashMap = (); pub struct Struct1 { vec_1 : Vec< String >, - hashmap_strings_1 : std::collections::HashMap< String, String >, - hashset_strings_1 : std::collections::HashSet< String >, + hashmap_1 : std::collections::HashMap< String, String >, + hashset_1 : std::collections::HashSet< String >, } // diff --git a/module/core/former/tests/inc/former_tests/only_test/containers_with_subformer.rs b/module/core/former/tests/inc/former_tests/only_test/containers_with_subformer.rs index c0117b5473..a161ec02c5 100644 --- a/module/core/former/tests/inc/former_tests/only_test/containers_with_subformer.rs +++ b/module/core/former/tests/inc/former_tests/only_test/containers_with_subformer.rs @@ -16,8 +16,8 @@ tests_impls_optional! // fields let former = Struct1::former(); a_id!( former.storage.vec_1, None ); - a_id!( former.storage.hashmap_strings_1, None ); - a_id!( former.storage.hashset_strings_1, None ); + a_id!( former.storage.hashmap_1, None ); + a_id!( former.storage.hashset_1, None ); a_id!( former.context, None ); // form @@ -67,8 +67,8 @@ tests_impls_optional! let exp : Struct1 = Struct1 { vec_1 : vec![ "a".to_string(), "b".to_string() ], - hashmap_strings_1 : hmap!{}, - hashset_strings_1 : hset!{}, + hashmap_1 : hmap!{}, + hashset_1 : hset!{}, }; a_id!( got, exp ); @@ -81,8 +81,8 @@ tests_impls_optional! let exp : Struct1 = Struct1 { vec_1 : vec![ "a".to_string(), "b".to_string() ], - hashmap_strings_1 : hmap!{}, - hashset_strings_1 : hset!{}, + hashmap_1 : hmap!{}, + hashset_1 : hset!{}, }; a_id!( got, exp ); @@ -104,8 +104,8 @@ tests_impls_optional! let expected = Struct1 { vec_1 : vec![ "ghi".to_string(), "klm".to_string() ], - hashmap_strings_1 : hmap!{}, - hashset_strings_1 : hset!{}, + hashmap_1 : hmap!{}, + hashset_1 : hset!{}, }; a_id!( command, expected ); @@ -117,8 +117,8 @@ tests_impls_optional! let expected = Struct1 { vec_1 : vec![ "a".to_string(), "bc".to_string(), "def".to_string() ], - hashmap_strings_1 : hmap!{}, - hashset_strings_1 : hset!{}, + hashmap_1 : hmap!{}, + hashset_1 : hset!{}, }; a_id!( command, expected ); @@ -128,8 +128,8 @@ tests_impls_optional! let expected = Struct1 { vec_1 : vec![ "a".to_string(), "bc".to_string(), "def".to_string() ], - hashmap_strings_1 : hmap!{}, - hashset_strings_1 : hset!{}, + hashmap_1 : hmap!{}, + hashset_1 : hset!{}, }; a_id!( command, expected ); @@ -143,8 +143,8 @@ tests_impls_optional! let expected = Struct1 { vec_1 : vec![ "a".to_string(), "bc".to_string(), "def".to_string(), "gh".to_string() ], - hashmap_strings_1 : hmap!{}, - hashset_strings_1 : hset!{}, + hashmap_1 : hmap!{}, + hashset_1 : hset!{}, }; a_id!( command, expected ); } @@ -157,7 +157,7 @@ tests_impls_optional! // test.case( "implicit construction" ); let command = Struct1::former() - .hashmap_strings_1().add( ( "k1".to_string(), "v1".to_string() ) ).add( ( "k2".to_string(), "v2".to_string() ) ).end() + .hashmap_1().add( ( "k1".to_string(), "v1".to_string() ) ).add( ( "k2".to_string(), "v2".to_string() ) ).end() .form() ; // dbg!( &command ); @@ -165,41 +165,41 @@ tests_impls_optional! let expected = Struct1 { vec_1 : vec![], - hashmap_strings_1 : hmap!{ "k1".to_string() => "v1".to_string(), "k2".to_string() => "v2".to_string() }, - hashset_strings_1 : hset!{}, + hashmap_1 : hmap!{ "k1".to_string() => "v1".to_string(), "k2".to_string() => "v2".to_string() }, + hashset_1 : hset!{}, }; a_id!( command, expected ); // test.case( "replace" ); let command = Struct1::former() - .hashmap_strings_1().replace( hmap!{ "k1".to_string() => "v1".to_string(), "k2".to_string() => "v2".to_string() } ).end() + .hashmap_1().replace( hmap!{ "k1".to_string() => "v1".to_string(), "k2".to_string() => "v2".to_string() } ).end() .form() ; let expected = Struct1 { vec_1 : vec![], - hashmap_strings_1 : hmap!{ "k1".to_string() => "v1".to_string(), "k2".to_string() => "v2".to_string() }, - hashset_strings_1 : hset!{}, + hashmap_1 : hmap!{ "k1".to_string() => "v1".to_string(), "k2".to_string() => "v2".to_string() }, + hashset_1 : hset!{}, }; a_id!( command, expected ); let command = Struct1::former() - .hashmap_strings_1().add( ( "x".to_string(), "v1".to_string() ) ).replace( hmap!{ "k1".to_string() => "v1".to_string(), "k2".to_string() => "v2".to_string() } ).end() + .hashmap_1().add( ( "x".to_string(), "v1".to_string() ) ).replace( hmap!{ "k1".to_string() => "v1".to_string(), "k2".to_string() => "v2".to_string() } ).end() .form() ; let expected = Struct1 { vec_1 : vec![], - hashmap_strings_1 : hmap!{ "k1".to_string() => "v1".to_string(), "k2".to_string() => "v2".to_string() }, - hashset_strings_1 : hset!{}, + hashmap_1 : hmap!{ "k1".to_string() => "v1".to_string(), "k2".to_string() => "v2".to_string() }, + hashset_1 : hset!{}, }; a_id!( command, expected ); // test.case( "replace and add" ); let command = Struct1::former() - .hashmap_strings_1().replace( hmap!{ "k1".to_string() => "v1".to_string(), "k2".to_string() => "v2".to_string() } ) + .hashmap_1().replace( hmap!{ "k1".to_string() => "v1".to_string(), "k2".to_string() => "v2".to_string() } ) .add( ( "k3".to_string(), "v3".to_string() ) ).end() .form() ; @@ -208,8 +208,8 @@ tests_impls_optional! let expected = Struct1 { vec_1 : vec![], - hashmap_strings_1 : hmap!{ "k1".to_string() => "v1".to_string(), "k2".to_string() => "v2".to_string(), "k3".to_string() => "v3".to_string() }, - hashset_strings_1 : hset!{}, + hashmap_1 : hmap!{ "k1".to_string() => "v1".to_string(), "k2".to_string() => "v2".to_string(), "k3".to_string() => "v3".to_string() }, + hashset_1 : hset!{}, }; a_id!( command, expected ); } @@ -222,7 +222,7 @@ tests_impls_optional! // test.case( "implicit construction" ); let command = Struct1::former() - .hashset_strings_1().add( "v1" ).add( "v2" ).end() + .hashset_1().add( "v1" ).add( "v2" ).end() .form() ; // dbg!( &command ); @@ -230,41 +230,41 @@ tests_impls_optional! let expected = Struct1 { vec_1 : vec![], - hashmap_strings_1 : hmap!{}, - hashset_strings_1 : hset!{ "v1".to_string(), "v2".to_string() }, + hashmap_1 : hmap!{}, + hashset_1 : hset!{ "v1".to_string(), "v2".to_string() }, }; a_id!( command, expected ); // test.case( "replace" ); let command = Struct1::former() - .hashset_strings_1().replace( hset!{ "v1".to_string(), "v2".to_string() } ).end() + .hashset_1().replace( hset!{ "v1".to_string(), "v2".to_string() } ).end() .form() ; let expected = Struct1 { vec_1 : vec![], - hashmap_strings_1 : hmap!{}, - hashset_strings_1 : hset!{ "v1".to_string(), "v2".to_string() }, + hashmap_1 : hmap!{}, + hashset_1 : hset!{ "v1".to_string(), "v2".to_string() }, }; a_id!( command, expected ); let command = Struct1::former() - .hashset_strings_1().add( "x" ).replace( hset!{ "v1".to_string(), "v2".to_string() } ).end() + .hashset_1().add( "x" ).replace( hset!{ "v1".to_string(), "v2".to_string() } ).end() .form() ; let expected = Struct1 { vec_1 : vec![], - hashmap_strings_1 : hmap!{}, - hashset_strings_1 : hset!{ "v1".to_string(), "v2".to_string() }, + hashmap_1 : hmap!{}, + hashset_1 : hset!{ "v1".to_string(), "v2".to_string() }, }; a_id!( command, expected ); // test.case( "replace and add" ); let command = Struct1::former() - .hashset_strings_1().replace( hset!{ "v1".to_string(), "v2".to_string() } ).add( "v3" ).end() + .hashset_1().replace( hset!{ "v1".to_string(), "v2".to_string() } ).add( "v3" ).end() .form() ; // dbg!( &command ); @@ -272,8 +272,8 @@ tests_impls_optional! let expected = Struct1 { vec_1 : vec![], - hashmap_strings_1 : hmap!{}, - hashset_strings_1 : hset!{ "v1".to_string(), "v2".to_string(), "v3".to_string() }, + hashmap_1 : hmap!{}, + hashset_1 : hset!{ "v1".to_string(), "v2".to_string(), "v3".to_string() }, }; a_id!( command, expected ); } @@ -285,16 +285,16 @@ tests_impls_optional! let command = Struct1::former() .vec_1().add( "ghi" ).add( "klm" ).end() - .hashmap_strings_1().add( ( "k1".to_string(), "v1".to_string() ) ).add( ( "k2".to_string(), "v2".to_string() ) ).end() - .hashset_strings_1().add( "k1" ).end() + .hashmap_1().add( ( "k1".to_string(), "v1".to_string() ) ).add( ( "k2".to_string(), "v2".to_string() ) ).end() + .hashset_1().add( "k1" ).end() .form(); // dbg!( &command ); let expected = Struct1 { vec_1 : vec![ "ghi".to_string(), "klm".to_string() ], - hashmap_strings_1 : hmap!{ "k1".to_string() => "v1".to_string(), "k2".to_string() => "v2".to_string() }, - hashset_strings_1 : hset!{ "k1".to_string() }, + hashmap_1 : hmap!{ "k1".to_string() => "v1".to_string(), "k2".to_string() => "v2".to_string() }, + hashset_1 : hset!{ "k1".to_string() }, }; a_id!( command, expected ); diff --git a/module/core/former/tests/inc/former_tests/only_test/containers_without_subformer.rs b/module/core/former/tests/inc/former_tests/only_test/containers_without_subformer.rs index 990ae7e8cf..72b86f7fe0 100644 --- a/module/core/former/tests/inc/former_tests/only_test/containers_without_subformer.rs +++ b/module/core/former/tests/inc/former_tests/only_test/containers_without_subformer.rs @@ -15,8 +15,8 @@ tests_impls! let former = Struct1::former(); a_id!( former.storage.vec_1, None ); - a_id!( former.storage.hashmap_strings_1, None ); - a_id!( former.storage.hashset_strings_1, None ); + a_id!( former.storage.hashmap_1, None ); + a_id!( former.storage.hashset_1, None ); a_id!( former.context, None ); a_id!( print!( "{:?}", former.on_end ), print!( "{:?}", Some( the_module::ReturnPreformed ) ) ); let former2 = Struct1Former::< Struct1FormerDefinition >::new( the_module::ReturnPreformed ); @@ -24,18 +24,18 @@ tests_impls! let command = Struct1::former().form(); a_id!( command.vec_1, Vec::< String >::new() ); - a_id!( command.hashmap_strings_1, hmap!{} ); - a_id!( command.hashset_strings_1, hset![] ); + a_id!( command.hashmap_1, hmap!{} ); + a_id!( command.hashset_1, hset![] ); let command = Struct1::former().perform(); a_id!( command.vec_1, Vec::< String >::new() ); - a_id!( command.hashmap_strings_1, hmap!{} ); - a_id!( command.hashset_strings_1, hset![] ); + a_id!( command.hashmap_1, hmap!{} ); + a_id!( command.hashset_1, hset![] ); let command = Struct1::former().end(); a_id!( command.vec_1, Vec::< String >::new() ); - a_id!( command.hashmap_strings_1, hmap!{} ); - a_id!( command.hashset_strings_1, hset![] ); + a_id!( command.hashmap_1, hmap!{} ); + a_id!( command.hashset_1, hset![] ); } @@ -55,8 +55,8 @@ tests_impls! let expected = Struct1 { vec_1 : vec![ "ghi".to_string(), "klm".to_string() ], - hashmap_strings_1 : hmap!{}, - hashset_strings_1 : hset!{}, + hashmap_1 : hmap!{}, + hashset_1 : hset!{}, }; a_id!( command, expected ); } @@ -69,7 +69,7 @@ tests_impls! // test.case( "construction" ); let command = Struct1::former() - .hashmap_strings_1( hmap!{ "k1".to_string() => "v1".to_string(), "k2".to_string() => "v2".to_string() } ) + .hashmap_1( hmap!{ "k1".to_string() => "v1".to_string(), "k2".to_string() => "v2".to_string() } ) .form() ; // dbg!( &command ); @@ -77,8 +77,8 @@ tests_impls! let expected = Struct1 { vec_1 : vec![], - hashmap_strings_1 : hmap!{ "k1".to_string() => "v1".to_string(), "k2".to_string() => "v2".to_string() }, - hashset_strings_1 : hset!{}, + hashmap_1 : hmap!{ "k1".to_string() => "v1".to_string(), "k2".to_string() => "v2".to_string() }, + hashset_1 : hset!{}, }; a_id!( command, expected ); } @@ -90,7 +90,7 @@ tests_impls! // test.case( "construction" ); let command = Struct1::former() - .hashset_strings_1( hset!{ "v1".to_string(), "v2".to_string() } ) + .hashset_1( hset!{ "v1".to_string(), "v2".to_string() } ) .form() ; // dbg!( &command ); @@ -98,8 +98,8 @@ tests_impls! let expected = Struct1 { vec_1 : vec![], - hashmap_strings_1 : hmap!{}, - hashset_strings_1 : hset!{ "v1".to_string(), "v2".to_string() }, + hashmap_1 : hmap!{}, + hashset_1 : hset!{ "v1".to_string(), "v2".to_string() }, }; a_id!( command, expected ); } @@ -115,8 +115,8 @@ tests_impls! let expected = Struct1 { vec_1 : vec![], - hashmap_strings_1 : hmap!{}, - hashset_strings_1 : hset!{}, + hashmap_1 : hmap!{}, + hashset_1 : hset!{}, }; a_id!( command, expected ); } @@ -127,15 +127,15 @@ tests_impls! { let command = Struct1::former() .vec_1( vec![ "ghi".to_string(), "klm".to_string() ] ) - .hashmap_strings_1( hmap!{ "k1".to_string() => "v1".to_string(), "k2".to_string() => "v2".to_string() } ) + .hashmap_1( hmap!{ "k1".to_string() => "v1".to_string(), "k2".to_string() => "v2".to_string() } ) .form(); // dbg!( &command ); let expected = Struct1 { vec_1 : vec![ "ghi".to_string(), "klm".to_string() ], - hashmap_strings_1 : hmap!{ "k1".to_string() => "v1".to_string(), "k2".to_string() => "v2".to_string() }, - hashset_strings_1 : hset!{}, + hashmap_1 : hmap!{ "k1".to_string() => "v1".to_string(), "k2".to_string() => "v2".to_string() }, + hashset_1 : hset!{}, }; a_id!( command, expected ); 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 3b20fe8cd1..4d0aede6cf 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 @@ -535,7 +535,7 @@ tests_impls! .int_1( 13 ) .string_1( "Abcd".to_string() ) // .vec_1().push( "ghi" ).push( "klm" ).end() - // .hashmap_strings_1().insert( "k1", "v1" ).insert( "k2", "v2" ).end() + // .hashmap_1().insert( "k1", "v1" ).insert( "k2", "v2" ).end() .string_optional_1( "dir1" ) .form(); // dbg!( &command );