Skip to content

Commit

Permalink
comment: reserved_room_for_brace
Browse files Browse the repository at this point in the history
  • Loading branch information
kenoss committed Dec 28, 2024
1 parent 0eecc48 commit 0c5ee8e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1139,6 +1139,8 @@ impl Rewrite for UseTree {
if next_segment.is_some() {
rewritten_segment.push_str("::");
}
// If `next_segment` is a list, we should check overflow with `curr_segment` with
// open brace: `...::curr_segment{`. So, 1 will be added to a shape.
let reserved_room_for_brace = match next_segment.map(|s| &s.kind) {
Some(UseSegmentKind::List(_)) => "{".len(),
_ => 0,
Expand Down

0 comments on commit 0c5ee8e

Please sign in to comment.