Remove remaining uses of []
. This time I tried to use deref coercions where possible.
This commit is contained in:
parent
42e155e13b
commit
68e5bb3f2c
121 changed files with 730 additions and 731 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue