mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-09-28 12:10:37 +00:00
fs: remove unnecessary trait and lifetime bounds (#1655)
This commit is contained in:
parent
1cae04f8b3
commit
4c97e9dc28
@ -19,7 +19,7 @@ use std::task::Poll;
|
||||
/// This is an async version of [`std::fs::read_dir`](std::fs::read_dir)
|
||||
pub async fn read_dir<P>(path: P) -> io::Result<ReadDir>
|
||||
where
|
||||
P: AsRef<Path> + Send + 'static,
|
||||
P: AsRef<Path>,
|
||||
{
|
||||
let path = path.as_ref().to_owned();
|
||||
let std = asyncify(|| std::fs::read_dir(path)).await?;
|
||||
|
@ -11,7 +11,7 @@ use std::path::Path;
|
||||
/// [std]: https://doc.rust-lang.org/std/fs/fn.symlink_metadata.html
|
||||
pub async fn symlink_metadata<P>(path: P) -> io::Result<Metadata>
|
||||
where
|
||||
P: AsRef<Path> + Send + 'static,
|
||||
P: AsRef<Path>,
|
||||
{
|
||||
let path = path.as_ref().to_owned();
|
||||
asyncify(|| std::fs::symlink_metadata(path)).await
|
||||
|
@ -19,7 +19,7 @@ use std::{io, path::Path};
|
||||
/// ```
|
||||
pub async fn write<P, C: AsRef<[u8]> + Unpin>(path: P, contents: C) -> io::Result<()>
|
||||
where
|
||||
P: AsRef<Path> + Send + Unpin + 'static,
|
||||
P: AsRef<Path>,
|
||||
{
|
||||
let path = path.as_ref().to_owned();
|
||||
let contents = contents.as_ref().to_owned();
|
||||
|
Loading…
x
Reference in New Issue
Block a user