File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -3121,15 +3121,18 @@ impl Build {
3121
3121
self . force_frame_pointer . unwrap_or_else ( || self . get_debug ( ) )
3122
3122
}
3123
3123
3124
- fn get_out_dir ( & self ) -> Result < PathBuf , Error > {
3124
+ fn get_out_dir ( & self ) -> Result < Cow < ' _ , Path > , Error > {
3125
3125
match & self . out_dir {
3126
- Some ( p) => Ok ( ( * * p) . into ( ) ) ,
3127
- None => Ok ( env:: var_os ( "OUT_DIR" ) . map ( PathBuf :: from) . ok_or_else ( || {
3128
- Error :: new (
3129
- ErrorKind :: EnvVarNotFound ,
3130
- "Environment variable OUT_DIR not defined." ,
3131
- )
3132
- } ) ?) ,
3126
+ Some ( p) => Ok ( Cow :: Borrowed ( & * * p) ) ,
3127
+ None => env:: var_os ( "OUT_DIR" )
3128
+ . map ( PathBuf :: from)
3129
+ . map ( Cow :: Owned )
3130
+ . ok_or_else ( || {
3131
+ Error :: new (
3132
+ ErrorKind :: EnvVarNotFound ,
3133
+ "Environment variable OUT_DIR not defined." ,
3134
+ )
3135
+ } ) ,
3133
3136
}
3134
3137
}
3135
3138
You can’t perform that action at this time.
0 commit comments