Skip to content

Reduce allocations in "Expand macro" formatter #8421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2021

Conversation

lnicola
Copy link
Member

@lnicola lnicola commented Apr 8, 2021

No description provided.

@lnicola
Copy link
Member Author

lnicola commented Apr 8, 2021

changelog fix

@lnicola lnicola changed the title Reduce allocations in "Expand macro" Reduce allocations in "Expand macro" formatter Apr 8, 2021
@lnicola lnicola force-pushed the insert-whitespace branch from da340d9 to 48b946b Compare April 8, 2021 14:37
res.push(' ');
}
res.push_str("{\n");
res.extend(iter::repeat(" ").take(2 * indent));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why we indent these at two and not four spaces.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because normally it will display in another pane, shorter should be better. But Im okay to change it to match rustfmt default.

@edwin0cheng
Copy link
Member

bors r+

@edwin0cheng
Copy link
Member

Btw I am working on a Ast based formatter discussed in #1665, and it should be used here instead.

@bors
Copy link
Contributor

bors bot commented Apr 8, 2021

@bors bors bot merged commit 94d9fc2 into rust-lang:master Apr 8, 2021
@lnicola lnicola deleted the insert-whitespace branch April 8, 2021 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants