Skip to content

Commit

Permalink
chore: rm useless check
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Dec 11, 2023
1 parent 711388b commit cc69fa8
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions crates/fmt/src/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1631,13 +1631,11 @@ impl<'a, W: Write> Formatter<'a, W> {
// import statements are followed by a new line, so if there are more than one
// we have a group
if self.blank_lines(current_loc.end(), next_loc.start()) > 1 {
import_groups.push(current_group);
current_group = Vec::new();
import_groups.push(std::mem::take(&mut current_group));
}
}
} else if !current_group.is_empty() {
import_groups.push(current_group);
current_group = Vec::new();
import_groups.push(std::mem::take(&mut current_group));
}
}

Expand Down Expand Up @@ -1667,10 +1665,6 @@ impl<'a, W: Write> Formatter<'a, W> {
}
}

if group.len() == 1 {
continue;
}

import_directives.sort_by_cached_key(|item| match item {
SourceUnitPart::ImportDirective(import) => match import {
Import::Plain(path, _) => path.to_string(),
Expand Down

0 comments on commit cc69fa8

Please sign in to comment.