1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#![allow(dead_code)] use generic_new::GenericNew; use std::path::PathBuf; #[derive(GenericNew)] struct Foo { bar: PathBuf, } #[derive(GenericNew)] struct FooTup(PathBuf); fn main() { Foo::new("hello"); FooTup::new("hello"); }