Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove TryFuture sealing
  • Loading branch information
Harry Barber committed Jul 19, 2023
commit 9e15e25d1cab668a0ae03cdd92fccfee90d9b2ad
12 changes: 1 addition & 11 deletions futures-core/src/future.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,9 @@ where
}
}

mod private_try_future {
use super::Future;

pub trait Sealed {}

impl<F, T, E> Sealed for F where F: ?Sized + Future<Output = Result<T, E>> {}
}

/// A convenience for futures that return `Result` values that includes
/// a variety of adapters tailored to such futures.
pub trait TryFuture:
Future<Output = Result<Self::Ok, Self::Error>> + private_try_future::Sealed
{
pub trait TryFuture: Future<Output = Result<Self::Ok, Self::Error>> {
/// The type of successful values yielded by this future
type Ok;

Expand Down