#![allow(clippy::used_underscore_binding, clippy::all, warnings, missing_docs)]
#![allow(unused_imports)]
#![allow(missing_docs)]
use former as the_module;
#[ cfg( not( feature = "no_std" ) ) ]
#[ cfg( feature = "derive_former" ) ]
#[ cfg( feature = "former_diagnostics_print_generated" ) ]
fn test_debug_attribute()
{
use former::Former;
#[ derive( Debug, PartialEq, Former ) ]
pub struct DebugStruct
{
field: String,
}
#[ derive( Debug, PartialEq, Former ) ]
pub struct GenericDebugStruct< T >
where
T: Clone,
{
generic_field: T,
normal_field: String,
}
#[ derive( Debug, PartialEq, Former ) ]
pub struct LifetimeDebugStruct< 'a, T >
where
T: Clone + 'a,
{
reference_field: &'a str,
generic_field: T,
}
#[ derive( Debug, PartialEq, Former ) ]
#[ storage_fields( temp_value: i32 ) ]
pub struct StorageFieldsDebugStruct
{
final_field: String,
}
let _simple = DebugStruct::former()
.field( "test".to_string() )
.form();
let _generic = GenericDebugStruct::former()
.generic_field( 42i32 )
.normal_field( "test".to_string() )
.form();
let test_str = "lifetime_test";
let _lifetime = LifetimeDebugStruct::former()
.reference_field( test_str )
.generic_field( "generic_value".to_string() )
.form();
let _storage = StorageFieldsDebugStruct::former()
.final_field( "final".to_string() )
.form();
println!("All debug attribute tests completed successfully!");
}
#[ cfg( not( feature = "no_std" ) ) ]
#[ cfg( feature = "derive_former" ) ]
#[ cfg( feature = "former_diagnostics_print_generated" ) ]
fn main()
{
test_debug_attribute();
}
#[ cfg( any( feature = "no_std", not( feature = "derive_former" ), not( feature = "former_diagnostics_print_generated" ) ) ) ]
fn main()
{
println!("Debug attribute test requires 'derive_former' and 'former_diagnostics_print_generated' features");
}