2 ms·
> But what's the difference between an async function returning int, and a function returning `impl Future<int>`? If there's no difference why do we need the as
by kibwen 5y ago
> But what's the difference between an async function returning int, and a function returning `impl Future<int>`? If there's no difference why do we need the async keyword?
No difference, but while the feature was being explored early users found it simpler if they didn't need to think about lifetimes on the returned future. Sometimes sugar is just sugar; same reason that `for` loops exist instead of just using `while`.