diff --git a/src/tostatic.rs b/src/tostatic.rs index 5df6c97..e6e1eb0 100644 --- a/src/tostatic.rs +++ b/src/tostatic.rs @@ -49,8 +49,6 @@ macro_rules! impl_tostatic_primitive { impl_tostatic_primitive!(bool); impl_tostatic_primitive!(I i8 i16 i32 i64 i128 isize); impl_tostatic_primitive!(I u8 u16 u32 u64 u128 usize); -impl_tostatic_primitive!(I String); -impl_tostatic_primitive!(str => String, |s| s.to_string()); impl ToStatic for &'_ T where @@ -63,17 +61,6 @@ where } } -impl ToStatic for Box -where - T: ToStatic, -{ - type Owned = Box; - - fn to_static(&self) -> Self::Owned { - Box::new(self.as_ref().to_static()) - } -} - impl ToStatic for Option where T: ToStatic, @@ -84,3 +71,20 @@ where self.as_ref().map(ToStatic::to_static) } } + +#[cfg(feature = "std")] +const _: () = { + impl_tostatic_primitive!(I String); + impl_tostatic_primitive!(str => String, |s| s.to_string()); + + impl ToStatic for Box + where + T: ToStatic, + { + type Owned = Box; + + fn to_static(&self) -> Self::Owned { + Box::new(self.as_ref().to_static()) + } + } +};