1 comment

[ 0.19 ms ] story [ 7.8 ms ] thread
It's interesting that you can remove a future state machine instance for an async function that returns a constant value by just returning impl Future<Output = [return type]> with return std::future::ready(return_value). They even developed a lint[1] to help users find these cases. https://github.com/rust-lang/rust-clippy/pull/16244

Could the compiler not identify this case and perform the transformation automatically?