From edeb4927829380ed25e3899e85b2809bbb39a846 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 9 May 2021 17:41:25 +0300 Subject: minor: fix test style --- .../handlers/replace_impl_trait_with_generic.rs | 86 ++++++++-------------- 1 file changed, 31 insertions(+), 55 deletions(-) (limited to 'crates/ide_assists/src') diff --git a/crates/ide_assists/src/handlers/replace_impl_trait_with_generic.rs b/crates/ide_assists/src/handlers/replace_impl_trait_with_generic.rs index ff25b61ea..8509a5e11 100644 --- a/crates/ide_assists/src/handlers/replace_impl_trait_with_generic.rs +++ b/crates/ide_assists/src/handlers/replace_impl_trait_with_generic.rs @@ -55,12 +55,8 @@ mod tests { fn replace_impl_trait_with_generic_params() { check_assist( replace_impl_trait_with_generic, - r#" - fn foo(bar: $0impl Bar) {} - "#, - r#" - fn foo(bar: B) {} - "#, + r#"fn foo(bar: $0impl Bar) {}"#, + r#"fn foo(bar: B) {}"#, ); } @@ -68,12 +64,8 @@ mod tests { fn replace_impl_trait_without_generic_params() { check_assist( replace_impl_trait_with_generic, - r#" - fn foo(bar: $0impl Bar) {} - "#, - r#" - fn foo(bar: B) {} - "#, + r#"fn foo(bar: $0impl Bar) {}"#, + r#"fn foo(bar: B) {}"#, ); } @@ -81,12 +73,8 @@ mod tests { fn replace_two_impl_trait_with_generic_params() { check_assist( replace_impl_trait_with_generic, - r#" - fn foo(foo: impl Foo, bar: $0impl Bar) {} - "#, - r#" - fn foo(foo: impl Foo, bar: B) {} - "#, + r#"fn foo(foo: impl Foo, bar: $0impl Bar) {}"#, + r#"fn foo(foo: impl Foo, bar: B) {}"#, ); } @@ -94,12 +82,8 @@ mod tests { fn replace_impl_trait_with_empty_generic_params() { check_assist( replace_impl_trait_with_generic, - r#" - fn foo<>(bar: $0impl Bar) {} - "#, - r#" - fn foo(bar: B) {} - "#, + r#"fn foo<>(bar: $0impl Bar) {}"#, + r#"fn foo(bar: B) {}"#, ); } @@ -108,13 +92,13 @@ mod tests { check_assist( replace_impl_trait_with_generic, r#" - fn foo< - >(bar: $0impl Bar) {} - "#, +fn foo< +>(bar: $0impl Bar) {} +"#, r#" - fn foo(bar: B) {} - "#, +fn foo(bar: B) {} +"#, ); } @@ -123,12 +107,8 @@ mod tests { fn replace_impl_trait_with_exist_generic_letter() { check_assist( replace_impl_trait_with_generic, - r#" - fn foo(bar: $0impl Bar) {} - "#, - r#" - fn foo(bar: C) {} - "#, + r#"fn foo(bar: $0impl Bar) {}"#, + r#"fn foo(bar: C) {}"#, ); } @@ -137,19 +117,19 @@ mod tests { check_assist( replace_impl_trait_with_generic, r#" - fn foo< - G: Foo, - F, - H, - >(bar: $0impl Bar) {} - "#, - r#" - fn foo< - G: Foo, - F, - H, B: Bar - >(bar: B) {} - "#, +fn foo< + G: Foo, + F, + H, +>(bar: $0impl Bar) {} +"#, + r#" +fn foo< + G: Foo, + F, + H, B: Bar +>(bar: B) {} +"#, ); } @@ -157,12 +137,8 @@ mod tests { fn replace_impl_trait_multiple() { check_assist( replace_impl_trait_with_generic, - r#" - fn foo(bar: $0impl Foo + Bar) {} - "#, - r#" - fn foo(bar: F) {} - "#, + r#"fn foo(bar: $0impl Foo + Bar) {}"#, + r#"fn foo(bar: F) {}"#, ); } } -- cgit v1.2.3