// Simply gives a rought count of the number of nodes in an AST.
-use crate::visit::*;
use crate::ast::*;
-use syntax_pos::Span;
+use crate::visit::*;
+use rustc_span::Span;
pub struct NodeCounter {
pub count: usize,
impl NodeCounter {
pub fn new() -> NodeCounter {
- NodeCounter {
- count: 0,
- }
+ NodeCounter { count: 0 }
}
}
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)
}