Auto merge of #9053 - AaronC81:fix-9052, r=flip1995

Fix suggestions for `async` closures in redundant_closure_call

Fixes #9052

changelog: Fix suggestions given by [`redundant_closure_call`] for async closures
This commit is contained in:
bors 2022-08-02 12:39:37 +00:00
commit 05e7d5481b
5 changed files with 109 additions and 8 deletions

View file

@ -315,6 +315,12 @@ impl<'a> Sugg<'a> {
Sugg::NonParen(Cow::Owned(format!("{{ {} }}", self)))
}
/// Convenience method to prefix the expression with the `async` keyword.
/// Can be used after `blockify` to create an async block.
pub fn asyncify(self) -> Sugg<'static> {
Sugg::NonParen(Cow::Owned(format!("async {}", self)))
}
/// Convenience method to create the `<lhs>..<rhs>` or `<lhs>...<rhs>`
/// suggestion.
pub fn range(self, end: &Self, limit: ast::RangeLimits) -> Sugg<'static> {