summaryrefslogtreecommitdiffstats
path: root/tokio/src/fs/file.rs
diff options
context:
space:
mode:
authorLinus Färnstrand <faern@faern.net>2019-10-26 17:40:38 +0200
committerCarl Lerche <me@carllerche.com>2019-10-26 08:40:38 -0700
commit474befd23c368a34a5f45aab0f3945212109a803 (patch)
tree0284891d5e80e191ab995f9cb517942b84fa2b2d /tokio/src/fs/file.rs
parent987ba7373cf95c570bf23768c6021f7a7508286e (diff)
chore: use argument position impl trait (#1690)
Diffstat (limited to 'tokio/src/fs/file.rs')
-rw-r--r--tokio/src/fs/file.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/tokio/src/fs/file.rs b/tokio/src/fs/file.rs
index aeb5dc28..9b81a278 100644
--- a/tokio/src/fs/file.rs
+++ b/tokio/src/fs/file.rs
@@ -115,10 +115,7 @@ impl File {
/// # Ok(())
/// # }
/// ```
- pub async fn open<P>(path: P) -> io::Result<File>
- where
- P: AsRef<Path>,
- {
+ pub async fn open(path: impl AsRef<Path>) -> io::Result<File> {
let path = path.as_ref().to_owned();
let std = asyncify(|| sys::File::open(path)).await?;
@@ -153,10 +150,7 @@ impl File {
/// # Ok(())
/// # }
/// ```
- pub async fn create<P>(path: P) -> io::Result<File>
- where
- P: AsRef<Path>,
- {
+ pub async fn create(path: impl AsRef<Path>) -> io::Result<File> {
let path = path.as_ref().to_owned();
let std_file = asyncify(move || sys::File::create(path)).await?;
Ok(File::from_std(std_file))