diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-11-19 11:54:46 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-19 11:54:46 +0530 |
| commit | 3c6fc06906472969beffbede0c350044aa56b21b (patch) | |
| tree | 80601247b3ab12b085d677ff7f72f093d18ff779 /compiler/rustc_parse | |
| parent | 7f35493e9964f8d2e62ac127d2d948b60846109b (diff) | |
| parent | e3036df0032bb6726408a9f6705acaf38e55d59f (diff) | |
| download | rust-3c6fc06906472969beffbede0c350044aa56b21b.tar.gz rust-3c6fc06906472969beffbede0c350044aa56b21b.zip | |
Rollup merge of #104566 - matthiaskrgr:clippy_perf_nov18, r=oli-obk
couple of clippy::perf fixes
Diffstat (limited to 'compiler/rustc_parse')
| -rw-r--r-- | compiler/rustc_parse/src/parser/diagnostics.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index 350b270cc3d..2558ac801ad 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -1660,14 +1660,14 @@ impl<'a> Parser<'a> { let left = begin_par_sp; let right = self.prev_token.span; let left_snippet = if let Ok(snip) = sm.span_to_prev_source(left) && - !snip.ends_with(" ") { + !snip.ends_with(' ') { " ".to_string() } else { "".to_string() }; let right_snippet = if let Ok(snip) = sm.span_to_next_source(right) && - !snip.starts_with(" ") { + !snip.starts_with(' ') { " ".to_string() } else { "".to_string() |
