diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-10-14 23:05:01 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-10-19 12:59:40 -0700 |
| commit | 9d5d97b55d6487ee23b805bc1acbaa0669b82116 (patch) | |
| tree | b72dcf7045e331e94ea0f8658d088ab42d917935 /src/libsyntax/print/pprust.rs | |
| parent | fb169d5543c84e11038ba2d07b538ec88fb49ca6 (diff) | |
| download | rust-9d5d97b55d6487ee23b805bc1acbaa0669b82116.tar.gz rust-9d5d97b55d6487ee23b805bc1acbaa0669b82116.zip | |
Remove a large amount of deprecated functionality
Spring cleaning is here! In the Fall! This commit removes quite a large amount of deprecated functionality from the standard libraries. I tried to ensure that only old deprecated functionality was removed. This is removing lots and lots of deprecated features, so this is a breaking change. Please consult the deprecation messages of the deleted code to see how to migrate code forward if it still needs migration. [breaking-change]
Diffstat (limited to 'src/libsyntax/print/pprust.rs')
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index d32828192e9..26cf79ff8f9 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -175,7 +175,7 @@ pub fn to_string(f: |&mut State| -> IoResult<()>) -> String { let obj: TraitObject = mem::transmute_copy(&s.s.out); let wr: Box<MemWriter> = mem::transmute(obj.data); let result = - String::from_utf8(Vec::from_slice(wr.get_ref().as_slice())).unwrap(); + String::from_utf8(wr.get_ref().as_slice().to_vec()).unwrap(); mem::forget(wr); result.to_string() } @@ -1466,7 +1466,7 @@ impl<'a> State<'a> { } ast::ExprMethodCall(ident, ref tys, ref args) => { let base_args = args.slice_from(1); - try!(self.print_expr(&**args.get(0))); + try!(self.print_expr(&*args[0])); try!(word(&mut self.s, ".")); try!(self.print_ident(ident.node)); if tys.len() > 0u { @@ -2144,7 +2144,7 @@ impl<'a> State<'a> { for &explicit_self in opt_explicit_self.iter() { let m = match explicit_self { &ast::SelfStatic => ast::MutImmutable, - _ => match decl.inputs.get(0).pat.node { + _ => match decl.inputs[0].pat.node { ast::PatIdent(ast::BindByValue(m), _, _) => m, _ => ast::MutImmutable } @@ -2319,7 +2319,7 @@ impl<'a> State<'a> { try!(self.commasep(Inconsistent, ints.as_slice(), |s, &idx| { if idx < generics.lifetimes.len() { - let lifetime = generics.lifetimes.get(idx); + let lifetime = &generics.lifetimes[idx]; s.print_lifetime_def(lifetime) } else { let idx = idx - generics.lifetimes.len(); @@ -2663,14 +2663,14 @@ impl<'a> State<'a> { ast::LitStr(ref st, style) => self.print_string(st.get(), style), ast::LitByte(byte) => { let mut res = String::from_str("b'"); - (byte as char).escape_default(|c| res.push_char(c)); - res.push_char('\''); + (byte as char).escape_default(|c| res.push(c)); + res.push('\''); word(&mut self.s, res.as_slice()) } ast::LitChar(ch) => { let mut res = String::from_str("'"); - ch.escape_default(|c| res.push_char(c)); - res.push_char('\''); + ch.escape_default(|c| res.push(c)); + res.push('\''); word(&mut self.s, res.as_slice()) } ast::LitInt(i, t) => { @@ -2717,7 +2717,7 @@ impl<'a> State<'a> { match self.literals { Some(ref lits) => { while self.cur_cmnt_and_lit.cur_lit < lits.len() { - let ltrl = (*(*lits).get(self.cur_cmnt_and_lit.cur_lit)).clone(); + let ltrl = (*lits)[self.cur_cmnt_and_lit.cur_lit].clone(); if ltrl.pos > pos { return None; } self.cur_cmnt_and_lit.cur_lit += 1u; if ltrl.pos == pos { return Some(ltrl); } @@ -2749,7 +2749,7 @@ impl<'a> State<'a> { comments::Mixed => { assert_eq!(cmnt.lines.len(), 1u); try!(zerobreak(&mut self.s)); - try!(word(&mut self.s, cmnt.lines.get(0).as_slice())); + try!(word(&mut self.s, cmnt.lines[0].as_slice())); zerobreak(&mut self.s) } comments::Isolated => { @@ -2767,7 +2767,7 @@ impl<'a> State<'a> { comments::Trailing => { try!(word(&mut self.s, " ")); if cmnt.lines.len() == 1u { - try!(word(&mut self.s, cmnt.lines.get(0).as_slice())); + try!(word(&mut self.s, cmnt.lines[0].as_slice())); hardbreak(&mut self.s) } else { try!(self.ibox(0u)); @@ -2813,7 +2813,7 @@ impl<'a> State<'a> { match self.comments { Some(ref cmnts) => { if self.cur_cmnt_and_lit.cur_cmnt < cmnts.len() { - Some((*cmnts.get(self.cur_cmnt_and_lit.cur_cmnt)).clone()) + Some(cmnts[self.cur_cmnt_and_lit.cur_cmnt].clone()) } else { None } |
