From 186431e178c04fed8744d81b834547700af46430 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Fri, 6 Nov 2020 21:51:15 +0100 Subject: Adjust test-texts in infer_function_return_type --- .../src/handlers/infer_function_return_type.rs | 156 ++++++++++----------- 1 file changed, 78 insertions(+), 78 deletions(-) (limited to 'crates/assists') diff --git a/crates/assists/src/handlers/infer_function_return_type.rs b/crates/assists/src/handlers/infer_function_return_type.rs index 80864c530..520d07ae0 100644 --- a/crates/assists/src/handlers/infer_function_return_type.rs +++ b/crates/assists/src/handlers/infer_function_return_type.rs @@ -124,11 +124,11 @@ mod tests { check_assist( infer_function_return_type, r#"fn foo() -> <|>_ { - 45 - }"#, + 45 +}"#, r#"fn foo() -> i32 { - 45 - }"#, + 45 +}"#, ); } @@ -138,11 +138,11 @@ mod tests { check_assist( infer_function_return_type, r#"fn foo() { - || -> _ {<|>45}; - }"#, + || -> _ {<|>45}; +}"#, r#"fn foo() { - || -> i32 {45}; - }"#, + || -> i32 {45}; +}"#, ); } @@ -152,11 +152,11 @@ mod tests { check_assist( infer_function_return_type, r#"fn foo() <|>{ - 45 - }"#, + 45 +}"#, r#"fn foo() -> i32 { - 45 - }"#, + 45 +}"#, ); } @@ -166,11 +166,11 @@ mod tests { check_assist( infer_function_return_type, r#"fn foo() { - || <|>45 - }"#, + || <|>45 +}"#, r#"fn foo() { - || -> i32 {45} - }"#, + || -> i32 {45} +}"#, ); } @@ -180,11 +180,11 @@ mod tests { check_assist( infer_function_return_type, r#"fn foo() { - 45<|> - }"#, + 45<|> +}"#, r#"fn foo() -> i32 { - 45 - }"#, + 45 +}"#, ); } @@ -193,19 +193,19 @@ mod tests { check_assist( infer_function_return_type, r#"fn foo() { - if true { - 3<|> - } else { - 5 - } - }"#, + if true { + 3<|> + } else { + 5 + } +}"#, r#"fn foo() -> i32 { - if true { - 3 - } else { - 5 - } - }"#, + if true { + 3 + } else { + 5 + } +}"#, ); } @@ -215,8 +215,8 @@ mod tests { check_assist_not_applicable( infer_function_return_type, r#"fn foo() -> i32 { - ( 45<|> + 32 ) * 123 - }"#, + ( 45<|> + 32 ) * 123 +}"#, ); } @@ -225,9 +225,9 @@ mod tests { check_assist_not_applicable( infer_function_return_type, r#"fn foo() { - let x = <|>3; - ( 45 + 32 ) * 123 - }"#, + let x = <|>3; + ( 45 + 32 ) * 123 +}"#, ); } @@ -236,8 +236,8 @@ mod tests { check_assist_not_applicable( infer_function_return_type, r#"fn foo() { - (<|>) - }"#, + (<|>) +}"#, ); } @@ -247,15 +247,15 @@ mod tests { check_assist( infer_function_return_type, r#"fn foo() { - |x: i32| { - x<|> - }; - }"#, + |x: i32| { + x<|> + }; +}"#, r#"fn foo() { - |x: i32| -> i32 { - x - }; - }"#, + |x: i32| -> i32 { + x + }; +}"#, ); } @@ -264,11 +264,11 @@ mod tests { check_assist( infer_function_return_type, r#"fn foo() { - |x: i32| { x<|> }; - }"#, + |x: i32| { x<|> }; +}"#, r#"fn foo() { - |x: i32| -> i32 { x }; - }"#, + |x: i32| -> i32 { x }; +}"#, ); } @@ -278,11 +278,11 @@ mod tests { check_assist( infer_function_return_type, r#"fn foo() { - |x: i32| x<|>; - }"#, + |x: i32| x<|>; +}"#, r#"fn foo() { - |x: i32| -> i32 {x}; - }"#, + |x: i32| -> i32 {x}; +}"#, ); } @@ -291,23 +291,23 @@ mod tests { check_assist( infer_function_return_type, r#"fn foo() { - || { - if true { - 3<|> - } else { - 5 - } - } - }"#, + || { + if true { + 3<|> + } else { + 5 + } + } +}"#, r#"fn foo() { - || -> i32 { - if true { - 3 - } else { - 5 - } - } - }"#, + || -> i32 { + if true { + 3 + } else { + 5 + } + } +}"#, ); } @@ -317,8 +317,8 @@ mod tests { check_assist_not_applicable( infer_function_return_type, r#"fn foo() { - || -> i32 { 3<|> } - }"#, + || -> i32 { 3<|> } +}"#, ); } @@ -327,11 +327,11 @@ mod tests { check_assist_not_applicable( infer_function_return_type, r#"fn foo() { - || -> i32 { - let x = 3<|>; - 6 - } - }"#, + || -> i32 { + let x = 3<|>; + 6 + } +}"#, ); } } -- cgit v1.2.3