logoalt Hacker News

lifthrasiirtoday at 8:12 AM1 replyview on HN

It is an explicit way to discard return values; `self.poll_read(cx)?` etc. alone would warn. Or in this case, `Poll<Result<(), Error>>` is unwrapped once and `Result<(), Error>` is being discarded. The decision to discard `Result<(), Error>` should have been intentional, albeit turned out to be not always the case.


Replies

watttoday at 8:39 AM

If they're not going to handle the return values, they should change the function signature to reflect this aspirational contract, that that function "never fails".

I see in the article they did change the poll_flush to run just-in-time at poll_shutdown. So they definitely can make a "best effort" poll_flush version that just does not return any errors for use in that loop.

But all in all? Amateur hour.

show 1 reply