File tree 1 file changed +2
-11
lines changed
1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change 12
12
13
13
use anyhow:: { Context , Result } ;
14
14
use ext4_view:: Ext4 ;
15
- use std:: ffi:: OsString ;
16
15
use std:: io:: { self , ErrorKind , Read , Write } ;
17
16
use std:: { env, process} ;
18
17
@@ -36,7 +35,8 @@ fn parse_args() -> Result<(std::path::PathBuf, ext4_view::PathBuf)> {
36
35
}
37
36
38
37
let filesystem = std:: path:: PathBuf :: from ( & args[ 1 ] ) ;
39
- let path = get_ext4_path ( args[ 2 ] . clone ( ) ) ?;
38
+ let path = ext4_view:: PathBuf :: try_from ( args[ 2 ] . clone ( ) )
39
+ . context ( "Invalid ext4 path" ) ?;
40
40
41
41
Ok ( ( filesystem, path) )
42
42
}
@@ -82,12 +82,3 @@ fn main() -> Result<()> {
82
82
}
83
83
}
84
84
}
85
-
86
- fn get_ext4_path ( s : OsString ) -> Result < ext4_view:: PathBuf > {
87
- // TODO: implement a better conversion on Windows.
88
- // https://github.com/nicholasbishop/ext4-view-rs/issues/361
89
- #[ cfg( windows) ]
90
- let s = s. to_str ( ) . context ( "Path is not UTF-8" ) ?;
91
-
92
- ext4_view:: PathBuf :: try_from ( s) . context ( "Invalid ext4 path" )
93
- }
You can’t perform that action at this time.
0 commit comments