1 2 3 4 5 6 7 8 9
pub trait AsStr { fn as_str(&self) -> &str; } impl<T: AsStr> AsStr for &T { fn as_str(&self) -> &str { (*self).as_str() } }