mirror of
https://github.com/Noratrieb/ice-104649.git
synced 2026-01-16 13:25:03 +01:00
more
This commit is contained in:
parent
79e9aa8d4f
commit
39b121e064
1 changed files with 2 additions and 9 deletions
11
src/main.rs
11
src/main.rs
|
|
@ -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 {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue