Skip to content

Commit

Permalink
Rustfmt all the things
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Jan 22, 2019
1 parent 38cdf63 commit d6c8063
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions clippy_lints/src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,23 @@ pub fn differing_macro_contexts(lhs: Span, rhs: Span) -> bool {
pub fn in_constant(cx: &LateContext<'_, '_>, id: NodeId) -> bool {
let parent_id = cx.tcx.hir().get_parent(id);
match cx.tcx.hir().get(parent_id) {
| Node::Item(&Item { node: ItemKind::Const(..), .. })
| Node::TraitItem(&TraitItem { node: TraitItemKind::Const(..), .. })
| Node::ImplItem(&ImplItem { node: ImplItemKind::Const(..), .. })
Node::Item(&Item {
node: ItemKind::Const(..),
..
})
| Node::TraitItem(&TraitItem {
node: TraitItemKind::Const(..),
..
})
| Node::ImplItem(&ImplItem {
node: ImplItemKind::Const(..),
..
})
| Node::AnonConst(_)
| Node::Item(&Item { node: ItemKind::Static(..), .. })
=> true,
| Node::Item(&Item {
node: ItemKind::Static(..),
..
}) => true,
_ => false,
}
}
Expand Down

0 comments on commit d6c8063

Please sign in to comment.