diff options
| author | kennytm <kennytm@gmail.com> | 2018-08-04 14:35:53 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-04 14:35:53 +0800 |
| commit | 59bfa8a884165bcd0bc73d9065673deb39ff695a (patch) | |
| tree | 711bebb3a1e911388b3d7a132d2aae9e77f2ffed /src/libstd/future.rs | |
| parent | a3653828265ee42d8db52056211ffc375017cf99 (diff) | |
| parent | 3a93e914ebe317a2b8267401e65e137961afc851 (diff) | |
| download | rust-59bfa8a884165bcd0bc73d9065673deb39ff695a.tar.gz rust-59bfa8a884165bcd0bc73d9065673deb39ff695a.zip | |
Rollup merge of #52995 - cramertj:smaller-await, r=withoutboats
Remove unnecessary local in await! generator
This makes `async { await!(future::ready(())) }` 4 bytes instead of 16. [Playground example](http://play.rust-lang.org/?gist=54c075599b9ff390fe505c75d6b98feb&version=nightly&mode=debug&edition=2018)
Diffstat (limited to 'src/libstd/future.rs')
| -rw-r--r-- | src/libstd/future.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/future.rs b/src/libstd/future.rs index c1cc36f3b41..12ea1ea9f9d 100644 --- a/src/libstd/future.rs +++ b/src/libstd/future.rs @@ -108,9 +108,9 @@ where #[unstable(feature = "gen_future", issue = "50547")] /// Polls a future in the current thread-local task context. -pub fn poll_in_task_cx<F>(f: &mut PinMut<F>) -> Poll<F::Output> +pub fn poll_in_task_cx<F>(f: PinMut<F>) -> Poll<F::Output> where F: Future { - get_task_cx(|cx| f.reborrow().poll(cx)) + get_task_cx(|cx| f.poll(cx)) } |
