E.g. rewrite futures::ready!(self.fut.poll_unpin(cx)) To self.fut.poll_unpin(cx)?
-
-
Show this thread
-
Tho I'd likely sooner write: Pin::new(&mut self.fut).poll(cx)?; Though I kind of wish Futures et al had an unpin method built in. Or like, a trait to auto-deref into an Unpin variant self.fut.poll(cx)?;
Show this thread -
But that doesn't seem like it's worth the effort because there's more important things to do than making the lives easier for the small group of people manually writing futures. One can dream tho.
Show this thread -
(also I should learn more about pin projections; feel like I can use them effectively, but don't fully get all of it yet)
Show this thread -
Okay yeah so implementing Try for Poll<T> isn't possible because Try is already implemented for Poll<Result<T, E>> :( Guess we'll have to sit this one out until we have
specializations
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=d7ab7634c2c99709c438ddc0c84decc0 …Show this thread -
Oh though if Try was implemented for `Result<Poll<T>>` that'd remove 50% of the futures::ready! calls in the codebase I'm working on.
Show this thread
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.