Misc changes (#14702)
This mainly fixes `with_leading_whitespace` not always adding the whitespace it can. changelog: None
This commit is contained in:
commit
daeb6a1d18
19 changed files with 90 additions and 55 deletions
|
|
@ -13,7 +13,7 @@ fn main() {
|
|||
//~^^^^^^ collapsible_if
|
||||
|
||||
// The following tests check for the fix of https://github.com/rust-lang/rust-clippy/issues/798
|
||||
if x == "hello" // Inner comment
|
||||
if x == "hello" // Inner comment
|
||||
&& y == "world" {
|
||||
println!("Hello world!");
|
||||
}
|
||||
|
|
@ -26,7 +26,7 @@ fn main() {
|
|||
}
|
||||
//~^^^^^^ collapsible_if
|
||||
|
||||
if x == "hello" /* Inner comment */
|
||||
if x == "hello" /* Inner comment */
|
||||
&& y == "world" {
|
||||
println!("Hello world!");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ LL | | }
|
|||
|
|
||||
help: collapse nested if block
|
||||
|
|
||||
LL ~ if x == "hello" // Inner comment
|
||||
LL ~ if x == "hello" // Inner comment
|
||||
LL ~ && y == "world" {
|
||||
LL | println!("Hello world!");
|
||||
LL ~ }
|
||||
|
|
@ -70,7 +70,7 @@ LL | | }
|
|||
|
|
||||
help: collapse nested if block
|
||||
|
|
||||
LL ~ if x == "hello" /* Inner comment */
|
||||
LL ~ if x == "hello" /* Inner comment */
|
||||
LL ~ && y == "world" {
|
||||
LL | println!("Hello world!");
|
||||
LL ~ }
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ fn main() {
|
|||
let _ = || {
|
||||
let _x = x;
|
||||
};
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
println!("test");
|
||||
});
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ LL | if x.is_empty() {
|
|||
LL | let _ = || {
|
||||
LL ~ let _x = x;
|
||||
LL | };
|
||||
LL ~ return ;
|
||||
LL ~ return;
|
||||
LL | }
|
||||
LL ~ println!("test");
|
||||
|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue