Skip to content

Commit

Permalink
feat(rust/async-dyn-dispatch): Snippets for async Rust functions (#471)
Browse files Browse the repository at this point in the history
* adding snippets for rust async functions and dynamic dispatch with Box<dyn T>
* remove box-dyn snippet
---------
Co-authored-by: Renan Vieira <2496686+renanvieira@users.noreply.github.com>
  • Loading branch information
renanvieira authored Jul 8, 2024
1 parent 6821579 commit 2c0e75a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions snippets/rust/rust.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 …(…) { … }"
}
}

0 comments on commit 2c0e75a

Please sign in to comment.