about summary refs log tree commit diff
path: root/src/libsyntax/print/pprust.rs
diff options
context:
space:
mode:
authorJeffrey Seyfried <jeffrey.seyfried@gmail.com>2016-06-18 04:01:57 +0000
committerJeffrey Seyfried <jeffrey.seyfried@gmail.com>2016-06-19 00:01:55 +0000
commit5033eca65f1dd9585aafa9cddd9d4bfd71b820c1 (patch)
treea5490b012b6243d778e9f1ac4a3b3010b1447ca8 /src/libsyntax/print/pprust.rs
parent114be1e9f0db2c84e38b5ed96d4e4450771e8a44 (diff)
downloadrust-5033eca65f1dd9585aafa9cddd9d4bfd71b820c1.tar.gz
rust-5033eca65f1dd9585aafa9cddd9d4bfd71b820c1.zip
Generalize and abstract `ThinAttributes`
Diffstat (limited to 'src/libsyntax/print/pprust.rs')
-rw-r--r--src/libsyntax/print/pprust.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index 0c90e102f34..620295fce88 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -14,7 +14,6 @@ use abi::{self, Abi};
 use ast::{self, TokenTree, BlockCheckMode, PatKind};
 use ast::{SelfKind, RegionTyParamBound, TraitTyParamBound, TraitBoundModifier};
 use ast::Attribute;
-use attr::ThinAttributesExt;
 use util::parser::AssocOp;
 use attr;
 use attr::{AttrMetaMethods, AttributeMethods};
@@ -1606,7 +1605,7 @@ impl<'a> State<'a> {
             }
             ast::StmtKind::Mac(ref mac, style, ref attrs) => {
                 try!(self.space_if_not_bol());
-                try!(self.print_outer_attributes(attrs.as_attr_slice()));
+                try!(self.print_outer_attributes(&attrs));
                 let delim = match style {
                     ast::MacStmtStyle::Braces => token::Brace,
                     _ => token::Paren
@@ -1946,7 +1945,7 @@ impl<'a> State<'a> {
                                   is_inline: bool) -> io::Result<()> {
         try!(self.maybe_print_comment(expr.span.lo));
 
-        let attrs = expr.attrs.as_attr_slice();
+        let attrs = &expr.attrs;
         if is_inline {
             try!(self.print_outer_attributes_inline(attrs));
         } else {
@@ -2090,9 +2089,7 @@ impl<'a> State<'a> {
                     let i_expr = body.expr.as_ref().unwrap();
                     match i_expr.node {
                         ast::ExprKind::Block(ref blk) => {
-                            try!(self.print_block_unclosed_with_attrs(
-                                &blk,
-                                i_expr.attrs.as_attr_slice()));
+                            try!(self.print_block_unclosed_with_attrs(&blk, &i_expr.attrs));
                         }
                         _ => {
                             // this is a bare expression
@@ -2281,7 +2278,7 @@ impl<'a> State<'a> {
         try!(self.maybe_print_comment(decl.span.lo));
         match decl.node {
             ast::DeclKind::Local(ref loc) => {
-                try!(self.print_outer_attributes(loc.attrs.as_attr_slice()));
+                try!(self.print_outer_attributes(&loc.attrs));
                 try!(self.space_if_not_bol());
                 try!(self.ibox(INDENT_UNIT));
                 try!(self.word_nbsp("let"));