Macro default_impl

Source
macro_rules! default_impl {
    ($tr: ty,$($x: ty),*) => { ... };
}
Expand description

Expands to the default implementation of a trait on all the types provided

ยงExample

trait Show: Display + Sized {
    fn show(&self) {
        println!("{self}");
    }
}

default_impl!(Show, u8, u16, u32, String, isize);