From 2c0e75ab5ea5aa8ec70a89df9491ace008d29924 Mon Sep 17 00:00:00 2001 From: Renan Chagas Date: Mon, 8 Jul 2024 05:30:10 +0200 Subject: [PATCH] feat(rust/async-dyn-dispatch): Snippets for async Rust functions (#471) * adding snippets for rust async functions and dynamic dispatch with Box * remove box-dyn snippet --------- Co-authored-by: Renan Vieira <2496686+renanvieira@users.noreply.github.com> --- snippets/rust/rust.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/snippets/rust/rust.json b/snippets/rust/rust.json index e84a6f6f..44d5333b 100644 --- a/snippets/rust/rust.json +++ b/snippets/rust/rust.json @@ -397,5 +397,23 @@ "prefix": "while", "body": ["while ${1:condition} {", " ${2:todo!();}", "}"], "description": "while … { … }" + }, + "pafn": { + "prefix": "pafn", + "body": [ + "pub async fn ${1:name}(${2:arg}: ${3:Type}) -> ${4:RetType} {", + " ${5:todo!();}", + "}" + ], + "description": "pub async fn …(…) { … }" + }, + "afn": { + "prefix": "afn", + "body": [ + "async fn ${1:name}(${2:arg}: ${3:Type}) -> ${4:RetType} {", + " ${5:todo!();}", + "}" + ], + "description": "async fn …(…) { … }" } }