diff options
Diffstat (limited to 'tokio-fs/src/rename.rs')
-rw-r--r-- | tokio-fs/src/rename.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tokio-fs/src/rename.rs b/tokio-fs/src/rename.rs index 1c2977ef..742ced04 100644 --- a/tokio-fs/src/rename.rs +++ b/tokio-fs/src/rename.rs @@ -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; /// Rename a file or directory to a new name, replacing the original file if /// `to` already exists. @@ -41,10 +44,9 @@ where P: AsRef<Path>, Q: 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::rename(&self.from, &self.to)) } } |