1
Fork 0

Rollup merge of #104566 - matthiaskrgr:clippy_perf_nov18, r=oli-obk

couple of clippy::perf fixes
This commit is contained in:
Dylan DPC 2022-11-19 11:54:46 +05:30 committed by GitHub
commit 3c6fc06906
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 14 additions and 16 deletions

View file

@ -582,7 +582,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()
@ -590,7 +590,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()