@@ -163,7 +163,7 @@ pub fn first_pkgid_src_in_workspace(pkgid: &PkgId, workspace: &Path) -> Option<P
163
163
pub fn built_executable_in_workspace ( pkgid : & PkgId , workspace : & Path ) -> Option < Path > {
164
164
let mut result = workspace. push ( "build" ) ;
165
165
// should use a target-specific subdirectory
166
- result = mk_output_path ( Main , Build , pkgid, & result) ;
166
+ result = mk_output_path ( Main , Build , pkgid, result) ;
167
167
debug ! ( "built_executable_in_workspace: checking whether %s exists" ,
168
168
result. to_str( ) ) ;
169
169
if os:: path_exists ( & result) {
@@ -191,7 +191,7 @@ pub fn built_bench_in_workspace(pkgid: &PkgId, workspace: &Path) -> Option<Path>
191
191
fn output_in_workspace ( pkgid : & PkgId , workspace : & Path , what : OutputType ) -> Option < Path > {
192
192
let mut result = workspace. push ( "build" ) ;
193
193
// should use a target-specific subdirectory
194
- result = mk_output_path ( what, Build , pkgid, & result) ;
194
+ result = mk_output_path ( what, Build , pkgid, result) ;
195
195
debug ! ( "output_in_workspace: checking whether %s exists" ,
196
196
result. to_str( ) ) ;
197
197
if os:: path_exists ( & result) {
@@ -357,7 +357,7 @@ fn target_file_in_workspace(pkgid: &PkgId, workspace: &Path,
357
357
create the %s dir (pkgid=%s, workspace=%s, what=%?, where=%?",
358
358
subdir, pkgid. to_str( ) , workspace. to_str( ) , what, where ) ) ) ;
359
359
}
360
- mk_output_path ( what, where, pkgid, & result)
360
+ mk_output_path ( what, where, pkgid, result)
361
361
}
362
362
363
363
/// Return the directory for <pkgid>'s build artifacts in <workspace>.
@@ -380,17 +380,14 @@ pub fn build_pkg_id_in_workspace(pkgid: &PkgId, workspace: &Path) -> Path {
380
380
/// Return the output file for a given directory name,
381
381
/// given whether we're building a library and whether we're building tests
382
382
pub fn mk_output_path ( what : OutputType , where : Target ,
383
- pkg_id : & PkgId , workspace : & Path ) -> Path {
383
+ pkg_id : & PkgId , workspace : Path ) -> Path {
384
384
let short_name_with_version = fmt ! ( "%s-%s" , pkg_id. short_name,
385
385
pkg_id. version. to_str( ) ) ;
386
386
// Not local_path.dir_path()! For package foo/bar/blat/, we want
387
387
// the executable blat-0.5 to live under blat/
388
388
let dir = match where {
389
389
// If we're installing, it just goes under <workspace>...
390
- Install => {
391
- // bad copy, but I just couldn't make the borrow checker happy
392
- ( * workspace) . clone ( )
393
- }
390
+ Install => workspace,
394
391
// and if we're just building, it goes in a package-specific subdir
395
392
Build => workspace. push_rel ( & * pkg_id. local_path )
396
393
} ;
0 commit comments