about summary refs log tree commit diff
path: root/compiler/rustc_lint
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-11-18 10:30:47 +0100
committerMatthias Krüger <matthias.krueger@famsik.de>2022-11-18 10:30:47 +0100
commite3036df0032bb6726408a9f6705acaf38e55d59f (patch)
treee8038b599a8a02930643f8d84275c23f16d4982e /compiler/rustc_lint
parent83356b78c4ff3e7d84e977aa6143793545967301 (diff)
downloadrust-e3036df0032bb6726408a9f6705acaf38e55d59f.tar.gz
rust-e3036df0032bb6726408a9f6705acaf38e55d59f.zip
couple of clippy::perf fixes
Diffstat (limited to 'compiler/rustc_lint')
-rw-r--r--compiler/rustc_lint/src/unused.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_lint/src/unused.rs b/compiler/rustc_lint/src/unused.rs
index ff0fb9bae92..bd6fe3c0dd8 100644
--- a/compiler/rustc_lint/src/unused.rs
+++ b/compiler/rustc_lint/src/unused.rs
@@ -584,7 +584,7 @@ trait UnusedDelimLint {
                 let sm = cx.sess().source_map();
                 let lo_replace =
                     if keep_space.0 &&
-                        let Ok(snip) = sm.span_to_prev_source(lo) && !snip.ends_with(" ") {
+                        let Ok(snip) = sm.span_to_prev_source(lo) && !snip.ends_with(' ') {
                         " ".to_string()
                         } else {
                             "".to_string()
@@ -592,7 +592,7 @@ trait UnusedDelimLint {
 
                 let hi_replace =
                     if keep_space.1 &&
-                        let Ok(snip) = sm.span_to_next_source(hi) && !snip.starts_with(" ") {
+                        let Ok(snip) = sm.span_to_next_source(hi) && !snip.starts_with(' ') {
                         " ".to_string()
                         } else {
                             "".to_string()