Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-assists/src/handlers/convert_closure_to_fn.rs')
| -rw-r--r-- | crates/ide-assists/src/handlers/convert_closure_to_fn.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/crates/ide-assists/src/handlers/convert_closure_to_fn.rs b/crates/ide-assists/src/handlers/convert_closure_to_fn.rs index e6d31b9660..c9f5e0a4fb 100644 --- a/crates/ide-assists/src/handlers/convert_closure_to_fn.rs +++ b/crates/ide-assists/src/handlers/convert_closure_to_fn.rs @@ -739,6 +739,25 @@ fn main() { } #[test] + fn handles_closures_with_unannotated_rest_patterns() { + check_assist( + convert_closure_to_fn, + r#" +fn main() { + let closure = |$0..| (); +} +"#, + r#" +fn main() { + fn closure(..: _) { + () + } +} +"#, + ); + } + + #[test] fn multiple_capture_usages() { check_assist( convert_closure_to_fn, |