From e1b8d836a9b64169a8337be674c78cac20940b92 Mon Sep 17 00:00:00 2001 From: Aleksei Sidorov Date: Fri, 4 Sep 2020 22:58:50 +0300 Subject: Remove unnecessary comma --- .../src/handlers/replace_impl_trait_with_generic.rs | 18 +++++++++--------- crates/assists/src/tests/generated.rs | 2 +- crates/syntax/src/ast/edit.rs | 1 - 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/crates/assists/src/handlers/replace_impl_trait_with_generic.rs b/crates/assists/src/handlers/replace_impl_trait_with_generic.rs index 748c528d4..6738bc134 100644 --- a/crates/assists/src/handlers/replace_impl_trait_with_generic.rs +++ b/crates/assists/src/handlers/replace_impl_trait_with_generic.rs @@ -11,7 +11,7 @@ use crate::{AssistContext, AssistId, AssistKind, Assists}; // ``` // -> // ``` -// fn foo(bar: B) {} +// fn foo(bar: B) {} // ``` pub(crate) fn replace_impl_trait_with_generic( acc: &mut Assists, @@ -59,7 +59,7 @@ mod tests { fn foo(bar: <|>impl Bar) {} "#, r#" - fn foo(bar: B) {} + fn foo(bar: B) {} "#, ); } @@ -72,7 +72,7 @@ mod tests { fn foo(bar: <|>impl Bar) {} "#, r#" - fn foo(bar: B) {} + fn foo(bar: B) {} "#, ); } @@ -85,7 +85,7 @@ mod tests { fn foo(foo: impl Foo, bar: <|>impl Bar) {} "#, r#" - fn foo(foo: impl Foo, bar: B) {} + fn foo(foo: impl Foo, bar: B) {} "#, ); } @@ -98,7 +98,7 @@ mod tests { fn foo<>(bar: <|>impl Bar) {} "#, r#" - fn foo(bar: B) {} + fn foo(bar: B) {} "#, ); } @@ -112,7 +112,7 @@ mod tests { >(bar: <|>impl Bar) {} "#, r#" - fn foo(bar: B) {} "#, ); @@ -127,7 +127,7 @@ mod tests { fn foo(bar: <|>impl Bar) {} "#, r#" - fn foo(bar: C) {} + fn foo(bar: C) {} "#, ); } @@ -147,7 +147,7 @@ mod tests { fn foo< G: Foo, F, - H, B: Bar, + H, B: Bar >(bar: B) {} "#, ); @@ -161,7 +161,7 @@ mod tests { fn foo(bar: <|>impl Foo + Bar) {} "#, r#" - fn foo(bar: F) {} + fn foo(bar: F) {} "#, ); } diff --git a/crates/assists/src/tests/generated.rs b/crates/assists/src/tests/generated.rs index 4e5ca3825..27d15adb0 100644 --- a/crates/assists/src/tests/generated.rs +++ b/crates/assists/src/tests/generated.rs @@ -822,7 +822,7 @@ fn doctest_replace_impl_trait_with_generic() { fn foo(bar: <|>impl Bar) {} "#####, r#####" -fn foo(bar: B) {} +fn foo(bar: B) {} "#####, ) } diff --git a/crates/syntax/src/ast/edit.rs b/crates/syntax/src/ast/edit.rs index 5b5454c72..8b1c65dd6 100644 --- a/crates/syntax/src/ast/edit.rs +++ b/crates/syntax/src/ast/edit.rs @@ -492,7 +492,6 @@ impl ast::GenericParamList { to_insert.push(space.into()); } to_insert.push(item.syntax().clone().into()); - to_insert.push(make::token(T![,]).into()); macro_rules! after_l_angle { () => {{ -- cgit v1.2.3