Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Define and use a
print_maybe_styled!
macro in libsyntax/diagnostic.rs
`EmitterWriter::print_maybe_styled` was basically always used with `format!`, so this macro makes some code cleaner. It should also remove some unnecessary allocations (most `print_maybe_styled` invocations allocated a `String` previously, whereas the new macro uses `write_fmt` to write the formatted string directly to the terminal). This probably could have been part of #26838, but it’s too late now.
- Loading branch information
Showing
1 changed file
with
38 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters