Skip to content

Commit

Permalink
Handle function declaration without body
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Sep 10, 2020
1 parent 2a3f75b commit a03d1d5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/rules/no_redeclare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ impl Visit for NoRedeclareVisitor {
noop_visit_type!();

fn visit_fn_decl(&mut self, f: &FnDecl, _: &dyn Node) {
if f.function.body.is_none() {
return;
}

self.declare(&f.ident);

f.visit_children_with(self);
Expand Down

0 comments on commit a03d1d5

Please sign in to comment.