about summary refs log tree commit diff
path: root/src/libsyntax/util/node_count.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-12-23 02:47:52 +0000
committerbors <bors@rust-lang.org>2019-12-23 02:47:52 +0000
commita916ac22b9f7f1f0f7aba0a41a789b3ecd765018 (patch)
tree139cba4184f0f290fdbdff1aa0aa68352b16ccbb /src/libsyntax/util/node_count.rs
parent9b98af84c4aa66392236fff59c86da2130d46d46 (diff)
parent0f24ccd21d9f734a21daaf3566900127167556d1 (diff)
downloadrust-a916ac22b9f7f1f0f7aba0a41a789b3ecd765018.tar.gz
rust-a916ac22b9f7f1f0f7aba0a41a789b3ecd765018.zip
Auto merge of #67540 - Mark-Simulacrum:fmt-the-world, r=Centril
Format the world

This PR modifies the formatting infrastructure a bit in the first commit (to enable the forgotten 2018 edition), as well as removes most directories from the ignore list in rustfmt.toml. It then follows that up with the second commit which runs `x.py fmt` and formats the entire repository.

We continue to not format the test directory (`src/test`) because of interactions with pretty printing and, in part, because re-blessing all of those files is somewhat harder to review, so is best suited for a follow up PR in my opinion.
Diffstat (limited to 'src/libsyntax/util/node_count.rs')
-rw-r--r--src/libsyntax/util/node_count.rs15
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)
     }