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