about summary refs log tree commit diff
path: root/src/libsyntax/std_inject.rs
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2015-02-20 14:08:14 -0500
committerNiko Matsakis <niko@alum.mit.edu>2015-02-20 14:08:14 -0500
commit68e5bb3f2caa34753edb7f921c0bcf1efd63cf88 (patch)
treed895a5d4acf70d2c9ed4104bdaf1631b2daa351f /src/libsyntax/std_inject.rs
parent42e155e13bf16b19251903ae51b2571925345771 (diff)
downloadrust-68e5bb3f2caa34753edb7f921c0bcf1efd63cf88.tar.gz
rust-68e5bb3f2caa34753edb7f921c0bcf1efd63cf88.zip
Remove remaining uses of `[]`. This time I tried to use deref coercions where possible.
Diffstat (limited to 'src/libsyntax/std_inject.rs')
-rw-r--r--src/libsyntax/std_inject.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsyntax/std_inject.rs b/src/libsyntax/std_inject.rs
index 4e4a571ede7..ac7cdb1b413 100644
--- a/src/libsyntax/std_inject.rs
+++ b/src/libsyntax/std_inject.rs
@@ -38,7 +38,7 @@ pub fn maybe_inject_prelude(krate: ast::Crate) -> ast::Crate {
 }
 
 pub fn use_std(krate: &ast::Crate) -> bool {
-    !attr::contains_name(&krate.attrs[], "no_std")
+    !attr::contains_name(&krate.attrs, "no_std")
 }
 
 fn no_prelude(attrs: &[ast::Attribute]) -> bool {
@@ -88,14 +88,14 @@ impl fold::Folder for PreludeInjector {
         // only add `use std::prelude::*;` if there wasn't a
         // `#![no_implicit_prelude]` at the crate level.
         // fold_mod() will insert glob path.
-        if !no_prelude(&krate.attrs[]) {
+        if !no_prelude(&krate.attrs) {
             krate.module = self.fold_mod(krate.module);
         }
         krate
     }
 
     fn fold_item(&mut self, item: P<ast::Item>) -> SmallVector<P<ast::Item>> {
-        if !no_prelude(&item.attrs[]) {
+        if !no_prelude(&item.attrs) {
             // only recur if there wasn't `#![no_implicit_prelude]`
             // on this item, i.e. this means that the prelude is not
             // implicitly imported though the whole subtree