use super :: *;
use test_tools ::a_id;
#[ derive( Debug, Clone, Copy, PartialEq ) ]
#[ allow( dead_code ) ]
pub struct IsTransparentSimple(bool);
impl From< bool > for IsTransparentSimple
{
fn from(src: bool) -> Self
{
Self(src)
}
}
#[ derive( Debug, Clone, Copy, PartialEq ) ]
#[ allow( dead_code ) ]
pub struct IsTransparentComplex< 'a, 'b: 'a, T, U: ToString + ?Sized, const N: usize >(&'a T, core ::marker ::PhantomData< &'b U >)
where
'a: 'b,
T: AsRef< U >;
impl< 'a, 'b: 'a, T, U: ToString + ?Sized, const N: usize > From< &'a T > for IsTransparentComplex< 'a, 'b, T, U, N >
where
'a: 'b,
T: AsRef< U >,
{
fn from(src: &'a T) -> Self
{
Self(src, core ::marker ::PhantomData)
}
}
#[ test ]
fn from_test()
{
a_id!(IsTransparentSimple ::from(true), IsTransparentSimple(true));
let got_tmp = "hello".to_string();
a_id!(IsTransparentComplex :: < '_, '_, String, str, 0 > ::from(&got_tmp), IsTransparentComplex :: < '_, '_, String, str, 0 >(&got_tmp, core ::marker ::PhantomData));
}