File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 1
- use anyhow:: { anyhow, Result } ;
1
+ use anyhow:: { anyhow, Context , Result } ;
2
2
use std:: {
3
3
mem,
4
4
path:: { Path , PathBuf } ,
@@ -48,11 +48,10 @@ impl BuildCommand {
48
48
let next = arg_iter. next ( ) ;
49
49
set (
50
50
& mut manifest_path,
51
- next. as_ref ( ) . map ( |p| {
52
- Path :: new ( & p)
53
- . canonicalize ( )
54
- . expect ( "--manifest-path invalid" )
55
- } ) ,
51
+ next. as_ref ( )
52
+ . map ( |p| Path :: new ( & p) . canonicalize ( ) )
53
+ . transpose ( )
54
+ . context ( "--manifest-path invalid" ) ?,
56
55
) ?;
57
56
cargo_args. push ( arg) ;
58
57
if let Some ( next) = next {
@@ -62,7 +61,7 @@ impl BuildCommand {
62
61
_ if arg. starts_with ( "--manifest-path=" ) => {
63
62
let path = Path :: new ( arg. trim_start_matches ( "--manifest-path=" ) )
64
63
. canonicalize ( )
65
- . expect ( "--manifest-path invalid" ) ;
64
+ . context ( "--manifest-path invalid" ) ? ;
66
65
set ( & mut manifest_path, Some ( path) ) ?;
67
66
cargo_args. push ( arg) ;
68
67
}
You can’t perform that action at this time.
0 commit comments