Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed Oct 2, 2024
1 parent bf3e754 commit d918a3c
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions tooling/nargo_fmt/src/visitor/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ use crate::{
visitor::expr::{format_seq, NewlineMode},
};
use noirc_frontend::ast::{
ItemVisibility, ModuleDeclaration, NoirFunction, TraitImplItemKind, UnresolvedTypeData,
Visibility,
ItemVisibility, NoirFunction, TraitImplItemKind, UnresolvedTypeData, Visibility,
};
use noirc_frontend::{
hir::resolution::errors::Span,
Expand Down Expand Up @@ -277,18 +276,12 @@ impl super::FmtVisitor<'_> {
self.push_rewrite(use_tree, span);
self.last_position = span.end();
}
ItemKind::ModuleDecl(ModuleDeclaration { outer_attributes, .. }) => {
if !outer_attributes.is_empty() {
self.push_rewrite(self.slice(span).to_string(), span);
self.last_position = span.end();
continue;
}
}

ItemKind::Struct(_)
| ItemKind::Trait(_)
| ItemKind::TypeAlias(_)
| ItemKind::Global(..)
| ItemKind::ModuleDecl(_)
| ItemKind::InnerAttribute(_) => {
self.push_rewrite(self.slice(span).to_string(), span);
self.last_position = span.end();
Expand Down

0 comments on commit d918a3c

Please sign in to comment.