mirror of
https://github.com/RGBCube/alejandra
synced 2025-07-29 03:27:44 +00:00
list&attr_set: add spaces to [] and {} when not empty
This commit is contained in:
parent
c68bef57c1
commit
a0cf26d62c
2 changed files with 6 additions and 6 deletions
|
@ -100,9 +100,7 @@ pub(crate) fn rule(
|
|||
steps.push_back(crate::builder::Step::Pad);
|
||||
steps.push_back(crate::builder::Step::FormatWider(child));
|
||||
} else {
|
||||
if item_index > 1 {
|
||||
steps.push_back(crate::builder::Step::Whitespace);
|
||||
}
|
||||
steps.push_back(crate::builder::Step::Whitespace);
|
||||
steps.push_back(crate::builder::Step::Format(child));
|
||||
}
|
||||
children.move_next();
|
||||
|
@ -116,6 +114,8 @@ pub(crate) fn rule(
|
|||
steps.push_back(crate::builder::Step::Dedent);
|
||||
steps.push_back(crate::builder::Step::NewLine);
|
||||
steps.push_back(crate::builder::Step::Pad);
|
||||
} else if items_count > 0 {
|
||||
steps.push_back(crate::builder::Step::Whitespace);
|
||||
}
|
||||
steps.push_back(crate::builder::Step::Format(child));
|
||||
|
||||
|
|
|
@ -73,9 +73,7 @@ pub(crate) fn rule(
|
|||
steps.push_back(crate::builder::Step::Pad);
|
||||
steps.push_back(crate::builder::Step::FormatWider(child));
|
||||
} else {
|
||||
if item_index > 1 {
|
||||
steps.push_back(crate::builder::Step::Whitespace);
|
||||
}
|
||||
steps.push_back(crate::builder::Step::Whitespace);
|
||||
steps.push_back(crate::builder::Step::Format(child));
|
||||
}
|
||||
|
||||
|
@ -90,6 +88,8 @@ pub(crate) fn rule(
|
|||
steps.push_back(crate::builder::Step::Dedent);
|
||||
steps.push_back(crate::builder::Step::NewLine);
|
||||
steps.push_back(crate::builder::Step::Pad);
|
||||
} else if items_count > 0 {
|
||||
steps.push_back(crate::builder::Step::Whitespace);
|
||||
}
|
||||
steps.push_back(crate::builder::Step::Format(child));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue