diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-26 13:57:10 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-26 13:57:10 +0000 |
commit | 2664aee8e5976f590e2fcb700982488ae2358780 (patch) | |
tree | 0861e2c6ad6eef00d327ccc07ae367fe44ba11db | |
parent | e0f2e1560fd1073c20c61cd0ab232be241f1121e (diff) | |
parent | 789efede824c8ae68b34051d8e822bcab4ae4155 (diff) |
Merge #7405
7405: fill_match_arms: don't duplicate Ident-like arms r=matklad a=bugadani
Co-authored-by: Dániel Buga <[email protected]>
-rw-r--r-- | crates/assists/src/handlers/fill_match_arms.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/crates/assists/src/handlers/fill_match_arms.rs b/crates/assists/src/handlers/fill_match_arms.rs index 7663d211d..4964ddc7d 100644 --- a/crates/assists/src/handlers/fill_match_arms.rs +++ b/crates/assists/src/handlers/fill_match_arms.rs | |||
@@ -272,6 +272,34 @@ mod tests { | |||
272 | } | 272 | } |
273 | 273 | ||
274 | #[test] | 274 | #[test] |
275 | fn partial_fill_option() { | ||
276 | check_assist( | ||
277 | fill_match_arms, | ||
278 | r#" | ||
279 | enum Option<T> { Some(T), None } | ||
280 | use Option::*; | ||
281 | |||
282 | fn main() { | ||
283 | match None$0 { | ||
284 | None => {} | ||
285 | } | ||
286 | } | ||
287 | "#, | ||
288 | r#" | ||
289 | enum Option<T> { Some(T), None } | ||
290 | use Option::*; | ||
291 | |||
292 | fn main() { | ||
293 | match None { | ||
294 | None => {} | ||
295 | Some(${0:_}) => {} | ||
296 | } | ||
297 | } | ||
298 | "#, | ||
299 | ); | ||
300 | } | ||
301 | |||
302 | #[test] | ||
275 | fn partial_fill_or_pat() { | 303 | fn partial_fill_or_pat() { |
276 | check_assist( | 304 | check_assist( |
277 | fill_match_arms, | 305 | fill_match_arms, |