From: Domantas Jadenkus Date: Mon, 24 May 2021 19:01:26 +0000 (+0300) Subject: add test that it does not create extraneous commas X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=3641abc0c3e3ffaa1f6b5bf9b280b4217ea93e67;p=rust.git add test that it does not create extraneous commas --- diff --git a/crates/ide_assists/src/handlers/fill_match_arms.rs b/crates/ide_assists/src/handlers/fill_match_arms.rs index 711ef2393dc..3d2cd739aea 100644 --- a/crates/ide_assists/src/handlers/fill_match_arms.rs +++ b/crates/ide_assists/src/handlers/fill_match_arms.rs @@ -1093,6 +1093,26 @@ fn foo(t: bool) { true => 1 + 2, $0false => todo!(), } +}"#, + ); + } + + #[test] + fn does_not_add_extra_comma() { + check_assist( + fill_match_arms, + r#" +fn foo(t: bool) { + match $0t { + true => 1 + 2, + } +}"#, + r#" +fn foo(t: bool) { + match t { + true => 1 + 2, + $0false => todo!(), + } }"#, ); }