diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-12-12 19:49:53 +0100 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2022-12-12 19:49:53 +0100 |
| commit | 2ea368e53c755fb13d3ad5cd59370a3f7ad4e8c0 (patch) | |
| tree | 10026afe25c4eca8d57fb9444793f89ca0581396 /compiler/rustc_errors/src | |
| parent | 37d7de337903a558dbeb1e82c844fe915ab8ff25 (diff) | |
| download | rust-2ea368e53c755fb13d3ad5cd59370a3f7ad4e8c0.tar.gz rust-2ea368e53c755fb13d3ad5cd59370a3f7ad4e8c0.zip | |
minor code cleanups
Diffstat (limited to 'compiler/rustc_errors/src')
| -rw-r--r-- | compiler/rustc_errors/src/diagnostic.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_errors/src/emitter.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_errors/src/diagnostic.rs b/compiler/rustc_errors/src/diagnostic.rs index 06bb5edc090..0f79bc558bf 100644 --- a/compiler/rustc_errors/src/diagnostic.rs +++ b/compiler/rustc_errors/src/diagnostic.rs @@ -802,7 +802,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" ); diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs index 4df2198fb0e..aaf0699f0dc 100644 --- a/compiler/rustc_errors/src/emitter.rs +++ b/compiler/rustc_errors/src/emitter.rs @@ -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() { |
