Skip to content

Commit c1400ca

Browse files
committed
clean up clone()
1 parent 741d9a8 commit c1400ca

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

tests/run-make/issue-11908/rmake.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,18 @@ use run_make_support::{dynamic_lib, rustc, tmp_dir};
1515
use std::fs;
1616

1717
fn main() {
18-
let mut tmp_dir_other = tmp_dir();
19-
tmp_dir_other.push("other");
18+
let tmp_dir_other = tmp_dir().join("other");
2019

21-
fs::create_dir(tmp_dir_other.clone());
20+
fs::create_dir(&tmp_dir_other);
2221
rustc().input("foo.rs").crate_type("dylib").codegen_option("prefer-dynamic").run();
23-
fs::rename(dynamic_lib("foo"), tmp_dir_other.clone());
22+
fs::rename(dynamic_lib("foo"), &tmp_dir_other);
2423
rustc().input("foo.rs").crate_type("dylib").codegen_option("prefer-dynamic").run();
25-
rustc().input("bar.rs").library_search_path(tmp_dir_other.clone()).run();
24+
rustc().input("bar.rs").library_search_path(&tmp_dir_other).run();
2625
fs::remove_dir_all(tmp_dir());
2726

28-
fs::create_dir_all(tmp_dir_other.clone());
27+
fs::create_dir_all(&tmp_dir_other);
2928
rustc().input("foo.rs").crate_type("rlib").run();
30-
let mut tmp_dir_libfoo = tmp_dir();
31-
tmp_dir_libfoo.push("libfoo.rlib");
32-
fs::rename(tmp_dir_libfoo, tmp_dir_other.clone());
29+
fs::rename(tmp_dir().join("libfoo.rlib"), &tmp_dir_other);
3330
rustc().input("foo.rs").crate_type("rlib").run();
34-
rustc().input("bar.rs").library_search_path(tmp_dir_other.clone()).run();
31+
rustc().input("bar.rs").library_search_path(tmp_dir_other).run();
3532
}

0 commit comments

Comments
 (0)