Rollup merge of #75359 - lcnr:unused-delims-trim, r=oli-obk
unused_delims: trim expr improves rustfix output.
This commit is contained in:
commit
ca462d36ff
@ -481,7 +481,8 @@ trait UnusedDelimLint {
|
||||
let mut err = lint.build(&span_msg);
|
||||
let mut ate_left_paren = false;
|
||||
let mut ate_right_paren = false;
|
||||
let parens_removed = pattern.trim_matches(|c| match c {
|
||||
let parens_removed = pattern
|
||||
.trim_matches(|c| match c {
|
||||
'(' | '{' => {
|
||||
if ate_left_paren {
|
||||
false
|
||||
@ -499,7 +500,8 @@ trait UnusedDelimLint {
|
||||
}
|
||||
}
|
||||
_ => false,
|
||||
});
|
||||
})
|
||||
.trim();
|
||||
|
||||
let replace = {
|
||||
let mut replace = if keep_space.0 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user