about summary refs log tree commit diff
path: root/src/bootstrap/format.rs
diff options
context:
space:
mode:
authorJoshua Nelson <jyn514@gmail.com>2020-09-15 00:08:37 -0400
committerJoshua Nelson <jyn514@gmail.com>2020-09-16 08:51:42 -0400
commitd04ca008e1c8ade73ec22976ff6a2a6a13ceabec (patch)
tree6479dc44883bc4b5dd02cd4290871f713f5d7a8c /src/bootstrap/format.rs
parent5fae56971d8487088c0099c82c0a5ce1638b5f62 (diff)
downloadrust-d04ca008e1c8ade73ec22976ff6a2a6a13ceabec.tar.gz
rust-d04ca008e1c8ade73ec22976ff6a2a6a13ceabec.zip
Remove unnecessary `clone()`s in bootstrap
The performance difference is negligible, but it makes me feel better.

Note that this does not remove some clones in `config`, because it would
require changing the logic around (and performance doesn't matter
for bootstrap).
Diffstat (limited to 'src/bootstrap/format.rs')
-rw-r--r--src/bootstrap/format.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/bootstrap/format.rs b/src/bootstrap/format.rs
index 6f93082e675..0ae9f9712d5 100644
--- a/src/bootstrap/format.rs
+++ b/src/bootstrap/format.rs
@@ -105,15 +105,13 @@ pub fn format(build: &Build, check: bool) {
         eprintln!("./x.py fmt is not supported on this channel");
         std::process::exit(1);
     });
-    let src = build.src.clone();
-    let walker = WalkBuilder::new(&build.src).types(matcher).overrides(ignore_fmt).build_parallel();
+    let src = &build.src;
+    let walker = WalkBuilder::new(src).types(matcher).overrides(ignore_fmt).build_parallel();
     walker.run(|| {
-        let src = src.clone();
-        let rustfmt_path = rustfmt_path.clone();
         Box::new(move |entry| {
             let entry = t!(entry);
             if entry.file_type().map_or(false, |t| t.is_file()) {
-                rustfmt(&src, &rustfmt_path, &entry.path(), check);
+                rustfmt(src, &rustfmt_path, &entry.path(), check);
             }
             ignore::WalkState::Continue
         })