Rollup merge of #105625 - matthiaskrgr:clippy_dec12, r=compiler-errors
minor code cleanups r? `@compiler-errors`
This commit is contained in:
commit
2707801858
8 changed files with 11 additions and 20 deletions
|
@ -806,7 +806,7 @@ impl Diagnostic {
|
|||
debug_assert!(
|
||||
!(suggestions
|
||||
.iter()
|
||||
.flat_map(|suggs| suggs)
|
||||
.flatten()
|
||||
.any(|(sp, suggestion)| sp.is_empty() && suggestion.is_empty())),
|
||||
"Span must not be empty and have no suggestion"
|
||||
);
|
||||
|
|
|
@ -1308,7 +1308,7 @@ impl EmitterWriter {
|
|||
// see how it *looks* with
|
||||
// very *weird* formats
|
||||
// see?
|
||||
for &(ref text, ref style) in msg.iter() {
|
||||
for (text, style) in msg.iter() {
|
||||
let text = self.translate_message(text, args);
|
||||
let lines = text.split('\n').collect::<Vec<_>>();
|
||||
if lines.len() > 1 {
|
||||
|
@ -1370,7 +1370,7 @@ impl EmitterWriter {
|
|||
buffer.append(0, ": ", header_style);
|
||||
label_width += 2;
|
||||
}
|
||||
for &(ref text, _) in msg.iter() {
|
||||
for (text, _) in msg.iter() {
|
||||
let text = self.translate_message(text, args);
|
||||
// Account for newlines to align output to its label.
|
||||
for (line, text) in normalize_whitespace(&text).lines().enumerate() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue