#![allow(clippy::used_underscore_binding, clippy::all, warnings, missing_docs)]
#[ allow( unused_imports ) ]
use super::*;
#[ allow( unused_imports ) ]
use test_tools::a_id;
#[ derive( Debug, PartialEq, the_module::Former ) ]
#[ storage_fields( a : i32, b : Option< String > ) ]
pub struct Struct1 {
c: String,
}
pub struct Struct1CustomEnd {
_phantom: core::marker::PhantomData<((),)>,
}
impl Default for Struct1CustomEnd {
#[ inline( always ) ]
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
#[ automatically_derived ]
impl<Context> former::FormingEnd<Struct1FormerDefinitionTypes<Context, Struct1>> for Struct1CustomEnd {
#[ inline( always ) ]
fn call(&self, storage: Struct1FormerStorage, super_former: Option<Context>) -> Struct1 {
let a = storage.a.unwrap_or_default();
let b = storage.b.unwrap_or_default();
Struct1 {
c: format!("{a:?} - {b}"),
}
}
}
tests_impls! {
fn test_complex()
{
let end = Struct1CustomEnd::default();
let got = Struct1Former
::< Struct1FormerDefinition< (), Struct1, _ > >
::new( end )
.a( 13 ).b( "abc" ).c( "def" ).form();
let exp = Struct1
{
c : "13 - abc".to_string(),
};
a_id!( got, exp );
}
}
tests_index! {
test_complex,
}