diff options
| author | lukaslueg <lukas.lueg@gmail.com> | 2021-04-06 18:23:21 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-06 18:23:21 +0200 |
| commit | 72796a7c36d60cd5d32e181dd0fca924399c2a03 (patch) | |
| tree | 157b3a3527632082291a2c17b39d22ab5395cfe1 /compiler/rustc_errors/src/styled_buffer.rs | |
| parent | 7f32fda78c60bb5b05e610a1c0c0fecaff07f497 (diff) | |
| parent | 5c897d430dcbec6b10a9925f7de054dbc0ad3c52 (diff) | |
| download | rust-72796a7c36d60cd5d32e181dd0fca924399c2a03.tar.gz rust-72796a7c36d60cd5d32e181dd0fca924399c2a03.zip | |
Merge branch 'master' into stab_peek_mut
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 }); |
