mirror of
https://github.com/rafamadriz/friendly-snippets
synced 2024-09-16 22:14:02 +02:00
feat(rust/async-dyn-dispatch): Snippets for async Rust functions (#471)
* 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>
This commit is contained in:
parent
682157939e
commit
2c0e75ab5e
1 changed files with 18 additions and 0 deletions
|
@ -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 …(…) { … }"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue