diff options
| author | Josh Stone <jistone@redhat.com> | 2021-03-08 15:32:41 -0800 |
|---|---|---|
| committer | Josh Stone <jistone@redhat.com> | 2021-03-26 09:32:31 -0700 |
| commit | 72ebebe474aae7203a27fdc1296617edd01321f1 (patch) | |
| tree | e3c47cd4378cc6370ad588318970b2118099fd2a /compiler/rustc_errors/src/styled_buffer.rs | |
| parent | 3b1f5e34620d6bfa32a127258e2c2d9f2f4d693b (diff) | |
| download | rust-72ebebe474aae7203a27fdc1296617edd01321f1.tar.gz rust-72ebebe474aae7203a27fdc1296617edd01321f1.zip | |
Use iter::zip in compiler/
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 }); |
