1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
pub mod decl { pub trait Empty<T> { const EMPTY: T; } } pub mod imple { use super::decl::Empty; impl Empty<&str> for &str { const EMPTY: &'static str = ""; } impl Empty<String> for String { const EMPTY: String = String::new(); } }