about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2021-10-11 23:45:48 +0200
committerGitHub <noreply@github.com>2021-10-11 23:45:48 +0200
commitd3984e16bf04f8ff886247cbf684041ba623d6ab (patch)
treeeb817a52bc1a0e32928a75aea5d02e170ed5b303 /src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
parentb80dd9e445e19fd82d305cd61cd266b0ee61bfee (diff)
parenta1e03fc563eaaab04b747cf8d3f1a0d8931e39fd (diff)
downloadrust-d3984e16bf04f8ff886247cbf684041ba623d6ab.tar.gz
rust-d3984e16bf04f8ff886247cbf684041ba623d6ab.zip
Rollup merge of #89651 - ibraheemdev:poll-ready, r=dtolnay
Add `Poll::ready` and revert stabilization of `task::ready!`

This PR adds an inherent `ready` method to `Poll` that can be used with the `?` operator as an alternative to the `task::ready!` macro:
```rust
let val = ready!(fut.poll(cx));
let val = fut.poll(cx).ready()?;
```

I think this form is a nice, non-breaking middle ground between changing the `impl Try for Poll`, and adding a separate macro. It looks better than `ready!` in my opinion, and it composes well:

```rust
let elem = ready!(fut.poll(cx)).pop().unwrap();
let elem = fut.poll(cx).ready()?.pop().unwrap();
```

The planned stabilization of `ready!` in 1.56 has been reverted because I think this alternate approach is worth considering.

r? rust-lang/libs
Diffstat (limited to 'src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs')
0 files changed, 0 insertions, 0 deletions