From 791003ad3c014c1ca12a29d35b4f8530aa4b7b76 Mon Sep 17 00:00:00 2001 From: Seo Sanghyeon Date: Tue, 10 Nov 2015 20:16:28 +0900 Subject: Use deref coercions --- src/libsyntax/config.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/libsyntax/config.rs') diff --git a/src/libsyntax/config.rs b/src/libsyntax/config.rs index aa674bdbcf3..10731178c06 100644 --- a/src/libsyntax/config.rs +++ b/src/libsyntax/config.rs @@ -86,7 +86,7 @@ fn filter_foreign_item(cx: &mut Context, -> Option> where F: FnMut(&[ast::Attribute]) -> bool { - if foreign_item_in_cfg(cx, &*item) { + if foreign_item_in_cfg(cx, &item) { Some(item) } else { None @@ -109,7 +109,7 @@ fn fold_foreign_mod(cx: &mut Context, fn fold_item(cx: &mut Context, item: P) -> SmallVector> where F: FnMut(&[ast::Attribute]) -> bool { - if item_in_cfg(cx, &*item) { + if item_in_cfg(cx, &item) { SmallVector::one(item.map(|i| cx.fold_item_simple(i))) } else { SmallVector::zero() @@ -189,7 +189,7 @@ fn retain_stmt(cx: &mut Context, stmt: &ast::Stmt) -> bool where ast::StmtDecl(ref decl, _) => { match decl.node { ast::DeclItem(ref item) => { - item_in_cfg(cx, &**item) + item_in_cfg(cx, item) } _ => true } @@ -203,7 +203,7 @@ fn fold_block(cx: &mut Context, b: P) -> P where { b.map(|ast::Block {id, stmts, expr, rules, span}| { let resulting_stmts: Vec> = - stmts.into_iter().filter(|a| retain_stmt(cx, &**a)).collect(); + stmts.into_iter().filter(|a| retain_stmt(cx, a)).collect(); let resulting_stmts = resulting_stmts.into_iter() .flat_map(|stmt| cx.fold_stmt(stmt).into_iter()) .collect(); @@ -263,7 +263,7 @@ fn in_cfg(diagnostic: &SpanHandler, cfg: &[P], attrs: &[ast::Attr return true; } - attr::cfg_matches(diagnostic, cfg, &*mis[0], + attr::cfg_matches(diagnostic, cfg, &mis[0], feature_gated_cfgs) }) } -- cgit 1.4.1-3-g733a5