From ef9c4b666f76cfaeea243760702d43719264f145 Mon Sep 17 00:00:00 2001 From: k-nasa Date: Wed, 13 Oct 2021 21:03:01 +0900 Subject: [PATCH] move test case --- .../src/handlers/replace_if_let_with_match.rs | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) 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 6f383ae8bba..f7b601d144a 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 @@ -574,6 +574,32 @@ fn main() { ) } + #[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(_)) => (), + _ => (), + } +"#, + ); + } + #[test] fn test_replace_match_with_if_let_unwraps_simple_expressions() { check_assist( @@ -885,32 +911,6 @@ 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(_)) => (), - _ => (), - } "#, ); } -- 2.44.0