diff options
| author | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-12-22 17:42:04 -0500 |
|---|---|---|
| committer | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-12-22 17:42:47 -0500 |
| commit | a06baa56b95674fc626b3c3fd680d6a65357fe60 (patch) | |
| tree | cd9d867c2ca3cff5c1d6b3bd73377c44649fb075 /src/libsyntax/util/node_count.rs | |
| parent | 8eb7c58dbb7b32701af113bc58722d0d1fefb1eb (diff) | |
| download | rust-a06baa56b95674fc626b3c3fd680d6a65357fe60.tar.gz rust-a06baa56b95674fc626b3c3fd680d6a65357fe60.zip | |
Format the world
Diffstat (limited to 'src/libsyntax/util/node_count.rs')
| -rw-r--r-- | src/libsyntax/util/node_count.rs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/libsyntax/util/node_count.rs b/src/libsyntax/util/node_count.rs index 3db9955d304..e768ab4c648 100644 --- a/src/libsyntax/util/node_count.rs +++ b/src/libsyntax/util/node_count.rs @@ -1,7 +1,7 @@ // Simply gives a rought count of the number of nodes in an AST. -use crate::visit::*; use crate::ast::*; +use crate::visit::*; use syntax_pos::Span; pub struct NodeCounter { @@ -10,9 +10,7 @@ pub struct NodeCounter { impl NodeCounter { pub fn new() -> NodeCounter { - NodeCounter { - count: 0, - } + NodeCounter { count: 0 } } } @@ -97,8 +95,13 @@ impl<'ast> Visitor<'ast> for NodeCounter { self.count += 1; walk_struct_field(self, s) } - fn visit_enum_def(&mut self, enum_definition: &EnumDef, - generics: &Generics, item_id: NodeId, _: Span) { + fn visit_enum_def( + &mut self, + enum_definition: &EnumDef, + generics: &Generics, + item_id: NodeId, + _: Span, + ) { self.count += 1; walk_enum_def(self, enum_definition, generics, item_id) } |
