1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
//! Somewhat useless traits /// Declaration of traits pub mod decl { pub trait Empty<T> { const EMPTY: T; } } /// Implementations of traits declared in `decl` for external types 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(); } }