Skip to content

Commit

Permalink
chore: revert changes to formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed Jun 17, 2024
1 parent ac9cdbc commit 8816095
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion tooling/nargo_fmt/src/rewrite/imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use crate::{
pub(crate) enum UseSegment {
Ident(String, Option<String>),
List(Vec<UseTree>),
Dep,
Crate,
}

Expand Down Expand Up @@ -47,6 +48,7 @@ impl UseSegment {
format!("{{{list_str}}}")
}
}
UseSegment::Dep => "dep".into(),
UseSegment::Crate => "crate".into(),
}
}
Expand All @@ -63,7 +65,8 @@ impl UseTree {

match use_tree.prefix.kind {
ast::PathKind::Crate => result.path.push(UseSegment::Crate),
ast::PathKind::Plain | ast::PathKind::Dep => {}
ast::PathKind::Dep => result.path.push(UseSegment::Dep),
ast::PathKind::Plain => {}
};

result.path.extend(
Expand Down
2 changes: 1 addition & 1 deletion tooling/nargo_fmt/tests/expected/singleton_import.nr
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
use std;
use dep::std;
use some_crate;
2 changes: 1 addition & 1 deletion tooling/nargo_fmt/tests/input/singleton_import.nr
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
use std;
use dep::std;
use some_crate;

0 comments on commit 8816095

Please sign in to comment.