From d7a04fdcb4f6c3b1ed6932a868ca95a6a4b6126e Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Tue, 14 Jul 2020 00:52:00 -0400 Subject: [PATCH] Note about fallback async methods --- _posts/2020-07-08-on-implementing-futures.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/_posts/2020-07-08-on-implementing-futures.md b/_posts/2020-07-08-on-implementing-futures.md index 99b1ed8..164fa01 100644 --- a/_posts/2020-07-08-on-implementing-futures.md +++ b/_posts/2020-07-08-on-implementing-futures.md @@ -180,3 +180,9 @@ help: consider further restricting this bound 15 | impl Future for MyStruct<'_, R3> { | ^^^^^^^^^^^^^^^^^^^^ ``` + +# Don't feel bad about fallbacks + +When used sparingly, either `#[async_trait]` or `Box::pin(async move {})` can enable async +functionality in code that will later not need the allocations. Use the escape hatch when you need +to such that you can continue making incremental improvements later.