1
Fork 0
mirror of https://github.com/RGBCube/alejandra synced 2025-07-30 12:07:46 +00:00

fix: attempt to substract with overflow

This commit is contained in:
Kevin Amado 2022-02-20 18:45:02 -05:00
parent 00f483212d
commit 2a2f9de552
2 changed files with 6 additions and 1 deletions

View file

@ -29,6 +29,7 @@ Types of changes
### Fixed
- All prebuilt binaries are now fully statically linked.
- An attempt to subtract with overflow in some scenarios of a `let-in` expression
## [0.3.0] - 2022-02-18

View file

@ -116,6 +116,7 @@ pub fn rule(
let child_expr = children.get_next().unwrap();
// in
let mut dedent = false;
steps.push_back(crate::builder::Step::Format(child_in.element));
match layout {
crate::config::Layout::Tall => {
@ -131,6 +132,7 @@ pub fn rule(
{
steps.push_back(crate::builder::Step::Whitespace);
} else {
dedent = true;
steps.push_back(crate::builder::Step::Indent);
steps.push_back(crate::builder::Step::NewLine);
steps.push_back(crate::builder::Step::Pad);
@ -152,7 +154,9 @@ pub fn rule(
steps.push_back(crate::builder::Step::FormatWider(
child_expr.element,
));
steps.push_back(crate::builder::Step::Dedent);
if dedent {
steps.push_back(crate::builder::Step::Dedent);
}
}
crate::config::Layout::Wide => {
steps.push_back(crate::builder::Step::Whitespace);