optional icon indicating copy to clipboard operation
optional copied to clipboard

Custom derive

Open CAD97 opened this issue 7 years ago • 0 comments

It would be very convenient if one could write

#[derive(Noned)]
pub struct Type(u32);

and have it expand to

pub struct Type(u32);

impl Noned for Type {
    fn is_none(&self) -> bool {
        self.0.is_none()
    }
    fn get_none() -> Self {
        Type(u32::get_none())
    }
}

(And the equivalents for OptEq/OptOrd)

CAD97 avatar Jan 20 '18 11:01 CAD97