File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change 1- use crate :: path:: { Path , PathBuf } ;
2-
31use crate :: io;
2+ use crate :: path:: { Path , PathBuf } ;
43use crate :: task:: blocking;
54
65/// Returns the canonical form of a path.
@@ -32,8 +31,6 @@ use crate::task::blocking;
3231/// # Ok(()) }) }
3332/// ```
3433pub async fn canonicalize < P : AsRef < Path > > ( path : P ) -> io:: Result < PathBuf > {
35- let path: PathBuf = path. as_ref ( ) . to_owned ( ) ;
36- Ok ( blocking:: spawn ( async move { std:: fs:: canonicalize ( & path) } )
37- . await ?
38- . into ( ) )
34+ let path = path. as_ref ( ) . to_owned ( ) ;
35+ blocking:: spawn ( async move { std:: fs:: canonicalize ( & path) . map ( Into :: into) } ) . await
3936}
Original file line number Diff line number Diff line change @@ -28,7 +28,5 @@ use crate::task::blocking;
2828/// ```
2929pub async fn read_link < P : AsRef < Path > > ( path : P ) -> io:: Result < PathBuf > {
3030 let path = path. as_ref ( ) . to_owned ( ) ;
31- Ok ( blocking:: spawn ( async move { std:: fs:: read_link ( path) } )
32- . await ?
33- . into ( ) )
31+ blocking:: spawn ( async move { std:: fs:: read_link ( path) . map ( Into :: into) } ) . await
3432}
You can’t perform that action at this time.
0 commit comments