optional
optional copied to clipboard
Custom derive
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
)