diff options
| author | Ben Brittain <ben@brittain.org> | 2018-07-29 07:37:24 -0700 |
|---|---|---|
| committer | Ben Brittain <ben@brittain.org> | 2018-07-29 08:05:38 -0700 |
| commit | 0b25f602fd60dc0961d8e507919328889ceeb32e (patch) | |
| tree | d943c9d73905a2bb749ac2ec7abd53c0aabe6f31 /src/utils.rs | |
| parent | 69ad879d52606ac03440744efa5b4d8ca8cc7566 (diff) | |
Format Async block and async fn
Diffstat (limited to 'src/utils.rs')
| -rw-r--r-- | src/utils.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/utils.rs b/src/utils.rs index b8474792cd3..3dbffd6d175 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -82,6 +82,14 @@ pub fn format_visibility(context: &RewriteContext, vis: &Visibility) -> Cow<'sta } #[inline] +pub fn format_asyncness(asyncness: ast::IsAsync) -> &'static str { + match asyncness { + ast::IsAsync::Async { .. } => "async ", + ast::IsAsync::NotAsync => "", + } +} + +#[inline] pub fn format_constness(constness: ast::Constness) -> &'static str { match constness { ast::Constness::Const => "const ", |
