diff --git a/crates/ide_assists/src/handlers/replace_if_let_with_match.rs b/crates/ide_assists/src/handlers/replace_if_let_with_match.rs index 8aad3e2f52b..6f383ae8bba 100644 --- a/crates/ide_assists/src/handlers/replace_if_let_with_match.rs +++ b/crates/ide_assists/src/handlers/replace_if_let_with_match.rs @@ -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) { + let bar: Result<_, ()> = Ok(Some(1)); + $0if let Ok(Some(_)) = bar { + () + } else { + () + } +} +"#, + r#" +fn foo(x: Result) { + let bar: Result<_, ()> = Ok(Some(1)); + match bar { + Ok(Some(_)) => (), + _ => (), + } "#, ); }