diff options
| author | GuillaumeGomez <guillaume1.gomez@gmail.com> | 2015-02-03 00:23:08 +0100 |
|---|---|---|
| committer | GuillaumeGomez <guillaume1.gomez@gmail.com> | 2015-02-06 11:59:10 +0100 |
| commit | d58c0a75978e068af8b01ab578b743c52635e1f4 (patch) | |
| tree | 2764c6584e8c3f9851fe65a686f07739db7e062d /src/libsyntax/parse | |
| parent | 966e6c0c370317f06aa85248c17c7081d9736d99 (diff) | |
| download | rust-d58c0a75978e068af8b01ab578b743c52635e1f4.tar.gz rust-d58c0a75978e068af8b01ab578b743c52635e1f4.zip | |
Replace the get method by the deref one on InternedString
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 7 | ||||
| -rw-r--r-- | src/libsyntax/parse/token.rs | 15 |
2 files changed, 5 insertions, 17 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index cae23c5a2cc..3ff51f99307 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -84,6 +84,7 @@ use std::mem; use std::num::Float; use std::rc::Rc; use std::slice; +use std::ops::Deref; bitflags! { flags Restrictions: u8 { @@ -5133,7 +5134,7 @@ impl<'a> Parser<'a> { outer_attrs, "path") { Some(d) => (dir_path.join(d), true), None => { - let mod_name = mod_string.get().to_string(); + let mod_name = mod_string.deref().to_string(); let default_path_str = format!("{}.rs", mod_name); let secondary_path_str = format!("{}/mod.rs", mod_name); let default_path = dir_path.join(&default_path_str[]); @@ -5145,7 +5146,7 @@ impl<'a> Parser<'a> { self.span_err(id_sp, "cannot declare a new module at this location"); let this_module = match self.mod_path_stack.last() { - Some(name) => name.get().to_string(), + Some(name) => name.deref().to_string(), None => self.root_module_name.as_ref().unwrap().clone(), }; self.span_note(id_sp, @@ -5191,7 +5192,7 @@ impl<'a> Parser<'a> { }; self.eval_src_mod_from_path(file_path, owns_directory, - mod_string.get().to_string(), id_sp) + mod_string.deref().to_string(), id_sp) } fn eval_src_mod_from_path(&mut self, diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 38e151436bf..755ccfb0094 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -625,19 +625,6 @@ impl InternedString { string: string, } } - - #[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 { @@ -652,7 +639,7 @@ impl BytesContainer for InternedString { // of `BytesContainer`, which is itself a workaround for the lack of // DST. unsafe { - let this = self.get(); + let this = self.deref(); mem::transmute::<&[u8],&[u8]>(this.container_as_bytes()) } } |
