feat: update mini tokio
This commit is contained in:
@@ -35,10 +35,7 @@ impl MiniTokio {
|
||||
}
|
||||
|
||||
/// Spawn a future onto the mini-tokio instance.
|
||||
fn spawn<F>(&mut self, future: F)
|
||||
where
|
||||
F: Future<Output=()> + Send + 'static,
|
||||
{
|
||||
fn spawn<F>(&mut self, future: F) where F: Future<Output=()> + Send + 'static, {
|
||||
self.tasks.push_back(Box::pin(future));
|
||||
}
|
||||
|
||||
@@ -62,9 +59,7 @@ struct Delay {
|
||||
impl Future for Delay {
|
||||
type Output = &'static str;
|
||||
|
||||
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>)
|
||||
-> Poll<&'static str>
|
||||
{
|
||||
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<&'static str> {
|
||||
if Instant::now() >= self.when {
|
||||
println!("Hello world");
|
||||
Poll::Ready("done")
|
||||
|
||||
Reference in New Issue
Block a user