-
Notifications
You must be signed in to change notification settings - Fork 931
Remove faulty shortcut in rewrite_string_lit
#241
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,5 +25,10 @@ not | |
remove | ||
formatting"#; | ||
|
||
let xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx = funktion("yyyyyyyyyyyyyyyyyyyyy\ | ||
yyyyyyyyyyyyyyyyyyyyy\ | ||
yyyyyyyyyyyyyyyyyyyyy\ | ||
yyyyyyyyyy"); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this doesn't look like an improvement, but I guess we need more infra to fix it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not an improvement on the test source, but it is an improvement on how rustfmt would previously format this. It would put everything on a single line. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. :-) |
||
"stuff" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we consider the position after formatting, rather than not checking at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could, but it would produce the same output as rewriting the string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iirc, string formatting can be expensive, so skipping it might be a win. OTOH, checking a multi-line string is within bounds is still O(n), so this might be premature optimisation.