Add test casee

This commit is contained in:
k-nasa 2021-10-09 11:13:27 +09:00
parent 545b068a77
commit 388525fa0d

View File

@ -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(_)) => (),
_ => (),
}
"#,
);
}