Skip to content

Commit 4ff6195

Browse files
authored
Rollup merge of #68252 - matthiaskrgr:redundant_clones, r=oli-obk
remove redundant clones, found by clippy
2 parents 9de54fa + 312c3a0 commit 4ff6195

File tree

5 files changed

+5
-7
lines changed

5 files changed

+5
-7
lines changed

src/librustc_driver/pretty.rs

-2
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,6 @@ pub fn print_after_hir_lowering<'tcx>(
429429
PpmSource(s) => {
430430
// Silently ignores an identified node.
431431
let out = &mut out;
432-
let src = src.clone();
433432
call_with_pp_support(&s, tcx.sess, Some(tcx), move |annotation| {
434433
debug!("pretty printing source code {:?}", s);
435434
let sess = annotation.sess();
@@ -447,7 +446,6 @@ pub fn print_after_hir_lowering<'tcx>(
447446

448447
PpmHir(s) => {
449448
let out = &mut out;
450-
let src = src.clone();
451449
call_with_pp_support_hir(&s, tcx, move |annotation, krate| {
452450
debug!("pretty printing source code {:?}", s);
453451
let sess = annotation.sess();

src/librustc_parse/parser/ty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ impl<'a> Parser<'a> {
500500
err.span_suggestion_short(
501501
lo.to(self.prev_span),
502502
"remove the parentheses",
503-
snippet.to_owned(),
503+
snippet,
504504
Applicability::MachineApplicable,
505505
);
506506
}

src/librustc_resolve/imports.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ impl<'a, 'b> ImportResolver<'a, 'b> {
718718
}
719719

720720
if !errors.is_empty() {
721-
self.throw_unresolved_import_error(errors.clone(), None);
721+
self.throw_unresolved_import_error(errors, None);
722722
}
723723
}
724724

src/librustdoc/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ impl Tester for Collector {
704704
debug!("creating test {}: {}", name, test);
705705
self.tests.push(testing::TestDescAndFn {
706706
desc: testing::TestDesc {
707-
name: testing::DynTestName(name.clone()),
707+
name: testing::DynTestName(name),
708708
ignore: match config.ignore {
709709
Ignore::All => true,
710710
Ignore::None => false,

src/libtest/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ fn run_test_in_process(
553553
Err(e) => calc_result(&desc, Err(e.as_ref()), &time_opts, &exec_time),
554554
};
555555
let stdout = data.lock().unwrap().to_vec();
556-
let message = CompletedTest::new(desc.clone(), test_result, exec_time, stdout);
556+
let message = CompletedTest::new(desc, test_result, exec_time, stdout);
557557
monitor_ch.send(message).unwrap();
558558
}
559559

@@ -602,7 +602,7 @@ fn spawn_test_subprocess(
602602
(result, test_output, exec_time)
603603
})();
604604

605-
let message = CompletedTest::new(desc.clone(), result, exec_time, test_output);
605+
let message = CompletedTest::new(desc, result, exec_time, test_output);
606606
monitor_ch.send(message).unwrap();
607607
}
608608

0 commit comments

Comments
 (0)