We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 533cb21 commit 6d60066Copy full SHA for 6d60066
clippy_utils/src/sugg.rs
@@ -315,6 +315,12 @@ impl<'a> Sugg<'a> {
315
Sugg::NonParen(Cow::Owned(format!("{{ {} }}", self)))
316
}
317
318
+ /// Convenience method to prefix the expression with the `async` keyword.
319
+ /// Can be used after `blockify` to create an async block.
320
+ pub fn asyncify(self) -> Sugg<'static> {
321
+ Sugg::NonParen(Cow::Owned(format!("async {}", self)))
322
+ }
323
+
324
/// Convenience method to create the `<lhs>..<rhs>` or `<lhs>...<rhs>`
325
/// suggestion.
326
pub fn range(self, end: &Self, limit: ast::RangeLimits) -> Sugg<'static> {
0 commit comments