1
Fork 0

Rename IntoFuture::Future to IntoFuture::IntoFuture

This commit is contained in:
Yoshua Wuyts 2022-03-10 20:29:35 +01:00
parent ba14a836c7
commit 3f2cb6eba1
2 changed files with 6 additions and 6 deletions

View file

@ -9,20 +9,20 @@ pub trait IntoFuture {
/// Which kind of future are we turning this into? /// Which kind of future are we turning this into?
#[unstable(feature = "into_future", issue = "67644")] #[unstable(feature = "into_future", issue = "67644")]
type Future: Future<Output = Self::Output>; type IntoFuture: Future<Output = Self::Output>;
/// Creates a future from a value. /// Creates a future from a value.
#[unstable(feature = "into_future", issue = "67644")] #[unstable(feature = "into_future", issue = "67644")]
#[lang = "into_future"] #[lang = "into_future"]
fn into_future(self) -> Self::Future; fn into_future(self) -> Self::IntoFuture;
} }
#[unstable(feature = "into_future", issue = "67644")] #[unstable(feature = "into_future", issue = "67644")]
impl<F: Future> IntoFuture for F { impl<F: Future> IntoFuture for F {
type Output = F::Output; type Output = F::Output;
type Future = F; type IntoFuture = F;
fn into_future(self) -> Self::Future { fn into_future(self) -> Self::IntoFuture {
self self
} }
} }

View file

@ -10,9 +10,9 @@ struct AwaitMe;
impl IntoFuture for AwaitMe { impl IntoFuture for AwaitMe {
type Output = i32; type Output = i32;
type Future = Pin<Box<dyn Future<Output = i32>>>; type IntoFuture = Pin<Box<dyn Future<Output = i32>>>;
fn into_future(self) -> Self::Future { fn into_future(self) -> Self::IntoFuture {
Box::pin(me()) Box::pin(me())
} }
} }