diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2020-06-09 15:57:08 +0200 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2020-06-09 18:51:08 +0200 |
| commit | 58023fedfc51efec1888c507617f41bde28b7da3 (patch) | |
| tree | c2df64ecfacd58d61f5bd9b9df1b656e34b71c17 /src/librustc_errors | |
| parent | feb3536eba10c2e4585d066629598f03d5ddc7c6 (diff) | |
| download | rust-58023fedfc51efec1888c507617f41bde28b7da3.tar.gz rust-58023fedfc51efec1888c507617f41bde28b7da3.zip | |
Fix more clippy warnings
Fixes more of: clippy::unused_unit clippy::op_ref clippy::useless_format clippy::needless_return clippy::useless_conversion clippy::bind_instead_of_map clippy::into_iter_on_ref clippy::redundant_clone clippy::nonminimal_bool clippy::redundant_closure clippy::option_as_ref_deref clippy::len_zero clippy::iter_cloned_collect clippy::filter_next
Diffstat (limited to 'src/librustc_errors')
| -rw-r--r-- | src/librustc_errors/annotate_snippet_emitter_writer.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/librustc_errors/annotate_snippet_emitter_writer.rs b/src/librustc_errors/annotate_snippet_emitter_writer.rs index 5b47364e714..265ba59cccb 100644 --- a/src/librustc_errors/annotate_snippet_emitter_writer.rs +++ b/src/librustc_errors/annotate_snippet_emitter_writer.rs @@ -159,14 +159,10 @@ impl AnnotateSnippetEmitterWriter { // FIXME(#59346): Not really sure when `fold` should be true or false fold: false, annotations: annotations - .into_iter() + .iter() .map(|annotation| SourceAnnotation { range: (annotation.start_col, annotation.end_col), - label: annotation - .label - .as_ref() - .map(|s| s.as_str()) - .unwrap_or_default(), + label: annotation.label.as_deref().unwrap_or_default(), annotation_type: annotation_type_for_level(*level), }) .collect(), |
