Skip to content

Commit 9f70e7f

Browse files
Use From impls for FutureObj<()>
1 parent 3d43f82 commit 9f70e7f

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/liballoc/boxed.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -950,29 +950,29 @@ unsafe impl<T, F: Future<Output = T> + 'static> UnsafeFutureObj<T> for PinBox<F>
950950
}
951951

952952
#[unstable(feature = "futures_api", issue = "50547")]
953-
impl<T, F: Future<Output = T> + Send + 'static> Into<FutureObj<T>> for PinBox<F> {
954-
fn into(self) -> FutureObj<T> {
955-
FutureObj::new(self)
953+
impl<F: Future<Output = ()> + Send + 'static> From<PinBox<F>> for FutureObj<()> {
954+
fn from(boxed: PinBox<F>) -> Self {
955+
FutureObj::new(boxed)
956956
}
957957
}
958958

959959
#[unstable(feature = "futures_api", issue = "50547")]
960-
impl<T, F: Future<Output = T> + Send + 'static> Into<FutureObj<T>> for Box<F> {
961-
fn into(self) -> FutureObj<T> {
962-
FutureObj::new(PinBox::from(self))
960+
impl<F: Future<Output = ()> + Send + 'static> From<Box<F>> for FutureObj<()> {
961+
fn from(boxed: Box<F>) -> Self {
962+
FutureObj::new(PinBox::from(boxed))
963963
}
964964
}
965965

966966
#[unstable(feature = "futures_api", issue = "50547")]
967-
impl<T, F: Future<Output = T> + 'static> Into<LocalFutureObj<T>> for PinBox<F> {
968-
fn into(self) -> LocalFutureObj<T> {
969-
LocalFutureObj::new(self)
967+
impl<F: Future<Output = ()> + 'static> From<PinBox<F>> for LocalFutureObj<()> {
968+
fn from(boxed: PinBox<F>) -> Self {
969+
LocalFutureObj::new(boxed)
970970
}
971971
}
972972

973973
#[unstable(feature = "futures_api", issue = "50547")]
974-
impl<T, F: Future<Output = T> + 'static> Into<LocalFutureObj<T>> for Box<F> {
975-
fn into(self) -> LocalFutureObj<T> {
976-
LocalFutureObj::new(PinBox::from(self))
974+
impl<F: Future<Output = ()> + 'static> From<Box<F>> for LocalFutureObj<()> {
975+
fn from(boxed: Box<F>) -> Self {
976+
LocalFutureObj::new(PinBox::from(boxed))
977977
}
978978
}

0 commit comments

Comments
 (0)