diff options
| author | Shotaro Yamada <sinkuu@sinkuu.xyz> | 2018-03-16 22:35:26 +0900 |
|---|---|---|
| committer | Shotaro Yamada <sinkuu@sinkuu.xyz> | 2018-07-27 23:26:36 +0900 |
| commit | 8296699faed63f713735fbfac53c0325ce45954e (patch) | |
| tree | c75befe75ce530a55b7bc1e15719972c9d796cfd /src/librustc_errors | |
| parent | 3525368a562435622c3c8f293354805e6961b0bf (diff) | |
Remove unnecessary `.collect()`
Diffstat (limited to 'src/librustc_errors')
| -rw-r--r-- | src/librustc_errors/emitter.rs | 4 | ||||
| -rw-r--r-- | src/librustc_errors/lib.rs | 5 |
2 files changed, 3 insertions, 6 deletions
diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs index a392278cab9..e0ed89a6416 100644 --- a/src/librustc_errors/emitter.rs +++ b/src/librustc_errors/emitter.rs @@ -528,9 +528,7 @@ impl EmitterWriter { // If there are no annotations or the only annotations on this line are // MultilineLine, then there's only code being shown, stop processing. - if line.annotations.is_empty() || line.annotations.iter() - .filter(|a| !a.is_line()).collect::<Vec<_>>().len() == 0 - { + if line.annotations.iter().all(|a| a.is_line()) { return vec![]; } diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs index c0f07645f49..400e5829d33 100644 --- a/src/librustc_errors/lib.rs +++ b/src/librustc_errors/lib.rs @@ -610,9 +610,8 @@ impl Handler { if can_show_explain && are_there_diagnostics { let mut error_codes = self.emitted_diagnostic_codes.borrow() - .clone() - .into_iter() - .filter_map(|x| match x { + .iter() + .filter_map(|x| match *x { DiagnosticId::Error(ref s) => Some(s.clone()), _ => None, }) |
