diff --git a/tokio/src/fs/copy.rs b/tokio/src/fs/copy.rs index 2d4556f2f..b47f28728 100644 --- a/tokio/src/fs/copy.rs +++ b/tokio/src/fs/copy.rs @@ -20,7 +20,7 @@ use std::path::Path; /// # } /// ``` -pub async fn copy, Q: AsRef>(from: P, to: Q) -> Result { +pub async fn copy(from: impl AsRef, to: impl AsRef) -> Result { let from = from.as_ref().to_owned(); let to = to.as_ref().to_owned(); asyncify(|| std::fs::copy(from, to)).await diff --git a/tokio/src/fs/dir_builder.rs b/tokio/src/fs/dir_builder.rs index 51207e478..b1849344b 100644 --- a/tokio/src/fs/dir_builder.rs +++ b/tokio/src/fs/dir_builder.rs @@ -96,7 +96,7 @@ impl DirBuilder { /// Ok(()) /// } /// ``` - pub async fn create>(&self, path: P) -> io::Result<()> { + pub async fn create(&self, path: impl AsRef) -> io::Result<()> { let path = path.as_ref().to_owned(); let mut builder = std::fs::DirBuilder::new(); builder.recursive(self.recursive); diff --git a/tokio/src/fs/write.rs b/tokio/src/fs/write.rs index 9b6cf5301..0ed908271 100644 --- a/tokio/src/fs/write.rs +++ b/tokio/src/fs/write.rs @@ -19,7 +19,7 @@ use std::{io, path::Path}; /// # Ok(()) /// # } /// ``` -pub async fn write + Unpin>(path: impl AsRef, contents: C) -> io::Result<()> { +pub async fn write(path: impl AsRef, contents: impl AsRef<[u8]>) -> io::Result<()> { let path = path.as_ref().to_owned(); let contents = contents.as_ref().to_owned();