Derive Macro fundamental_data_type::Deref

source ·
#[derive(Deref)]
Expand description

Derive macro to implement Deref when-ever it’s possible to do automatically.

§Sample :: struct instead of macro.

Write this

#[ derive( Deref ) ]
pub struct IsTransparent( bool );

Instead of this

pub struct IsTransparent( bool );
impl core::ops::Deref for IsTransparent
{
  type Target = bool;
  #[ inline( always ) ]
  fn deref( &self ) -> &Self::Target
  {
    &self.0
  }
}