This commit is contained in:
nora 2022-11-20 20:34:39 +01:00
parent 79e9aa8d4f
commit 39b121e064
No known key found for this signature in database

View file

@ -1,10 +1,6 @@
use std::marker::PhantomData;
use futures::{stream, Future, StreamExt}; use futures::{stream, Future, StreamExt};
pub struct JoinHandle<T> { pub struct JoinHandle<T>(T);
_p: PhantomData<T>,
}
impl<T> Future for JoinHandle<T> { impl<T> Future for JoinHandle<T> {
type Output = Result<T, ()>; type Output = Result<T, ()>;
@ -17,10 +13,7 @@ impl<T> Future for JoinHandle<T> {
} }
} }
pub fn spawn<T>(future: T) -> JoinHandle<T::Output> pub fn spawn<T: Future>(future: T) -> JoinHandle<T::Output> {
where
T: Future,
{
loop {} loop {}
} }