Add Str trait to InternedString, set get method deprecated
This commit is contained in:
parent
f3573aa834
commit
966e6c0c37
1 changed files with 8 additions and 0 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue