diff options
| author | Josef Reinhard Brandl <mail@josefbrandl.de> | 2018-06-30 19:37:28 +0200 |
|---|---|---|
| committer | Josef Reinhard Brandl <mail@josefbrandl.de> | 2018-07-02 13:59:39 +0200 |
| commit | 9f70e7fe3c4126bf8390a78e4740ade3261ac4df (patch) | |
| tree | cd049f472fbd42de6228918482e2933d4d381ddc /src/liballoc | |
| parent | 3d43f828f5f1261b88f00582074f6cd021f31614 (diff) | |
| download | rust-9f70e7fe3c4126bf8390a78e4740ade3261ac4df.tar.gz rust-9f70e7fe3c4126bf8390a78e4740ade3261ac4df.zip | |
Use `From` impls for `FutureObj<()>`
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/boxed.rs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index c1778ef101a..918ad657be9 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -950,29 +950,29 @@ unsafe impl<T, F: Future<Output = T> + 'static> UnsafeFutureObj<T> for PinBox<F> } #[unstable(feature = "futures_api", issue = "50547")] -impl<T, F: Future<Output = T> + Send + 'static> Into<FutureObj<T>> for PinBox<F> { - fn into(self) -> FutureObj<T> { - FutureObj::new(self) +impl<F: Future<Output = ()> + Send + 'static> From<PinBox<F>> for FutureObj<()> { + fn from(boxed: PinBox<F>) -> Self { + FutureObj::new(boxed) } } #[unstable(feature = "futures_api", issue = "50547")] -impl<T, F: Future<Output = T> + Send + 'static> Into<FutureObj<T>> for Box<F> { - fn into(self) -> FutureObj<T> { - FutureObj::new(PinBox::from(self)) +impl<F: Future<Output = ()> + Send + 'static> From<Box<F>> for FutureObj<()> { + fn from(boxed: Box<F>) -> Self { + FutureObj::new(PinBox::from(boxed)) } } #[unstable(feature = "futures_api", issue = "50547")] -impl<T, F: Future<Output = T> + 'static> Into<LocalFutureObj<T>> for PinBox<F> { - fn into(self) -> LocalFutureObj<T> { - LocalFutureObj::new(self) +impl<F: Future<Output = ()> + 'static> From<PinBox<F>> for LocalFutureObj<()> { + fn from(boxed: PinBox<F>) -> Self { + LocalFutureObj::new(boxed) } } #[unstable(feature = "futures_api", issue = "50547")] -impl<T, F: Future<Output = T> + 'static> Into<LocalFutureObj<T>> for Box<F> { - fn into(self) -> LocalFutureObj<T> { - LocalFutureObj::new(PinBox::from(self)) +impl<F: Future<Output = ()> + 'static> From<Box<F>> for LocalFutureObj<()> { + fn from(boxed: Box<F>) -> Self { + LocalFutureObj::new(PinBox::from(boxed)) } } |
