diff options
| author | Sean Cross <sean@xobs.io> | 2021-04-25 00:35:25 +0800 |
|---|---|---|
| committer | Sean Cross <sean@xobs.io> | 2021-04-25 00:35:25 +0800 |
| commit | f9d390d14ad891c4ce9fe108b86d6756ea5154ee (patch) | |
| tree | 5a12452fef7481362a5fcd06beb491ca4bcf7a69 /compiler/rustc_errors/src/styled_buffer.rs | |
| parent | 8f73fe91f5db7de6e42ad7824a00b9729d2925b2 (diff) | |
| parent | e11a9fa52a3f372dadd6db3d3f2ed7dc2621dcc4 (diff) | |
| download | rust-f9d390d14ad891c4ce9fe108b86d6756ea5154ee.tar.gz rust-f9d390d14ad891c4ce9fe108b86d6756ea5154ee.zip | |
Merge remote-tracking branch 'upstream/master' into impl-16351-nightly
Signed-off-by: Sean Cross <sean@xobs.io>
Diffstat (limited to 'compiler/rustc_errors/src/styled_buffer.rs')
| -rw-r--r-- | compiler/rustc_errors/src/styled_buffer.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_errors/src/styled_buffer.rs b/compiler/rustc_errors/src/styled_buffer.rs index ef71ee36ea3..ec122e7be6e 100644 --- a/compiler/rustc_errors/src/styled_buffer.rs +++ b/compiler/rustc_errors/src/styled_buffer.rs @@ -1,6 +1,7 @@ // Code for creating styled buffers use crate::snippet::{Style, StyledString}; +use std::iter; #[derive(Debug)] pub struct StyledBuffer { @@ -20,11 +21,11 @@ impl StyledBuffer { let mut output: Vec<Vec<StyledString>> = vec![]; let mut styled_vec: Vec<StyledString> = vec![]; - for (row, row_style) in self.text.iter().zip(&self.styles) { + for (row, row_style) in iter::zip(&self.text, &self.styles) { let mut current_style = Style::NoStyle; let mut current_text = String::new(); - for (&c, &s) in row.iter().zip(row_style) { + for (&c, &s) in iter::zip(row, row_style) { if s != current_style { if !current_text.is_empty() { styled_vec.push(StyledString { text: current_text, style: current_style }); |
