Add test casee
This commit is contained in:
parent
545b068a77
commit
388525fa0d
@ -885,6 +885,32 @@ fn foo() {
|
||||
Bar(bar) => println!("bar {}", bar),
|
||||
}
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn nested_type() {
|
||||
check_assist(
|
||||
replace_if_let_with_match,
|
||||
r#"
|
||||
//- minicore: result
|
||||
fn foo(x: Result<i32, ()>) {
|
||||
let bar: Result<_, ()> = Ok(Some(1));
|
||||
$0if let Ok(Some(_)) = bar {
|
||||
()
|
||||
} else {
|
||||
()
|
||||
}
|
||||
}
|
||||
"#,
|
||||
r#"
|
||||
fn foo(x: Result<i32, ()>) {
|
||||
let bar: Result<_, ()> = Ok(Some(1));
|
||||
match bar {
|
||||
Ok(Some(_)) => (),
|
||||
_ => (),
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user