Re:Update on await syntax in Rust
by hn_throwaway_99 on Tuesday May 28, 2019 @01:50PM
(#20032560)
I come from the Node world (I'm not really familiar with Rust at all), where the syntax is "await foo()", and to be honest I really like the .await syntax. First, as others have stated it makes the operator precedence clearer in my opinion. But more importantly, in my brain it makes it feel like await is a "member operator" of Promises (or I guess futures in the Rust case), so I can think "Function returns a promise, and then "calling" await on it yields and then returns the resolved object when done".
[ Parent
| on HN ]
There are no comments on this comment yet.