Skip to content

Why doesn't rustfmt format this vec![] of overlong constructors? #6547

Closed Answered by calebcartwright
thomasmost asked this question in Q&A
Discussion options

You must be logged in to vote

Because of the one very long string that's too long to possibly represent as a single-line string within the user-controllable max width limit. In this type of context rustfmt will simply defer to the human to format.

"All receipts should include a timezone that best represents either the customer's physical location at the time of purchase, or the merchant's region of business",

If you'd like to get rustfmt to be able to format these then you can either enable the format_strings config option to give it permission to wrap the string on your behalf, or manually split the string across multiple lines

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@thomasmost
Comment options

Answer selected by thomasmost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants