mod other { use typesafe_builders::prelude::*; #[derive(Builder)] pub struct Struct { #[builder(decay)] y: Option>, #[builder(decay)] z: Box>, } #[derive(Builder)] pub struct Optional { #[builder(decay)] #[builder(optional)] y: Option>, #[builder(decay)] #[builder(optional)] z: Box>, } } use other::*; fn main() { Struct::builder().y(Box::new(8)).z(Some(4)).build(); Struct::builder().y(8.into()).z(4.into()).build(); Optional::builder().build(); Optional::builder().y(Box::new(8)).build(); Optional::builder().z(Some(4)).build(); Optional::builder().y(Box::new(8)).z(Some(4)).build(); Optional::builder().y(8.into()).z(4.into()).build(); }