Add Str trait to InternedString, set get method deprecated

This commit is contained in:
GuillaumeGomez 2015-01-22 12:28:44 +01:00
parent f3573aa834
commit 966e6c0c37

View file

@ -627,11 +627,19 @@ impl InternedString {
}
#[inline]
#[deprecated = "use as_slice() instead"]
pub fn get<'a>(&'a self) -> &'a str {
&self.string[]
}
}
impl Str for InternedString {
#[inline]
fn as_slice<'a>(&'a self) -> &'a str {
&self.string[]
}
}
impl Deref for InternedString {
type Target = str;