Add if let
test case
This commit is contained in:
parent
84a60c3186
commit
8b36196cb6
2 changed files with 22 additions and 2 deletions
|
@ -76,11 +76,21 @@ fn good() {
|
|||
{ let foo = u64::max_value(); };
|
||||
{ let foo = u128::max_value(); };
|
||||
|
||||
let _ = match 42 {
|
||||
let x = 42;
|
||||
|
||||
let _ = match x {
|
||||
std::i8::MIN => -1,
|
||||
1..=std::i8::MAX => 1,
|
||||
_ => 0
|
||||
};
|
||||
|
||||
let _ = if let std::i8::MIN = x {
|
||||
-1
|
||||
} else if let 1..=std::i8::MAX = x {
|
||||
1
|
||||
} else {
|
||||
0
|
||||
};
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -76,11 +76,21 @@ fn good() {
|
|||
{ let foo = u64::max_value(); };
|
||||
{ let foo = u128::max_value(); };
|
||||
|
||||
let _ = match 42 {
|
||||
let x = 42;
|
||||
|
||||
let _ = match x {
|
||||
std::i8::MIN => -1,
|
||||
1..=std::i8::MAX => 1,
|
||||
_ => 0
|
||||
};
|
||||
|
||||
let _ = if let std::i8::MIN = x {
|
||||
-1
|
||||
} else if let 1..=std::i8::MAX = x {
|
||||
1
|
||||
} else {
|
||||
0
|
||||
};
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
Loading…
Add table
Reference in a new issue