Files
rust/library/core/src
Matthias Krüger d3984e16bf 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
2021-10-11 23:45:48 +02:00
..
2021-09-15 03:06:53 +00:00
2021-09-25 20:04:35 +02:00
2021-09-12 02:23:08 +00:00
2021-03-03 11:23:29 +01:00
2021-09-06 13:18:05 +02:00
2021-08-17 07:15:54 +00:00
2021-04-21 14:38:24 +02:00
2021-09-08 20:51:05 -04:00
2021-09-08 20:51:05 -04:00
2021-09-21 10:04:44 -05:00
2020-07-27 19:51:13 -05:00
2020-07-27 19:51:13 -05:00
2020-07-27 19:51:13 -05:00