mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-02 00:00:11 +02:00
fs: update to use std::future (#1269)
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
use futures::{Future, Poll};
|
||||
use std::fs;
|
||||
use std::future::Future;
|
||||
use std::io;
|
||||
use std::path::Path;
|
||||
use std::pin::Pin;
|
||||
use std::task::Context;
|
||||
use std::task::Poll;
|
||||
|
||||
/// Removes an existing, empty directory.
|
||||
///
|
||||
@@ -34,10 +37,9 @@ impl<P> Future for RemoveDirFuture<P>
|
||||
where
|
||||
P: AsRef<Path>,
|
||||
{
|
||||
type Item = ();
|
||||
type Error = io::Error;
|
||||
type Output = io::Result<()>;
|
||||
|
||||
fn poll(&mut self) -> Poll<Self::Item, Self::Error> {
|
||||
fn poll(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Self::Output> {
|
||||
crate::blocking_io(|| fs::remove_dir(&self.path))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user