remove redundant clones, found by clippy

This commit is contained in:
Matthias Krüger 2020-01-15 15:00:25 +01:00
parent c74353c7d2
commit 312c3a067a
5 changed files with 5 additions and 7 deletions

View File

@ -429,7 +429,6 @@ pub fn print_after_hir_lowering<'tcx>(
PpmSource(s) => {
// Silently ignores an identified node.
let out = &mut out;
let src = src.clone();
call_with_pp_support(&s, tcx.sess, Some(tcx), move |annotation| {
debug!("pretty printing source code {:?}", s);
let sess = annotation.sess();
@ -447,7 +446,6 @@ pub fn print_after_hir_lowering<'tcx>(
PpmHir(s) => {
let out = &mut out;
let src = src.clone();
call_with_pp_support_hir(&s, tcx, move |annotation, krate| {
debug!("pretty printing source code {:?}", s);
let sess = annotation.sess();

View File

@ -500,7 +500,7 @@ impl<'a> Parser<'a> {
err.span_suggestion_short(
lo.to(self.prev_span),
"remove the parentheses",
snippet.to_owned(),
snippet,
Applicability::MachineApplicable,
);
}

View File

@ -718,7 +718,7 @@ impl<'a, 'b> ImportResolver<'a, 'b> {
}
if !errors.is_empty() {
self.throw_unresolved_import_error(errors.clone(), None);
self.throw_unresolved_import_error(errors, None);
}
}

View File

@ -704,7 +704,7 @@ impl Tester for Collector {
debug!("creating test {}: {}", name, test);
self.tests.push(testing::TestDescAndFn {
desc: testing::TestDesc {
name: testing::DynTestName(name.clone()),
name: testing::DynTestName(name),
ignore: match config.ignore {
Ignore::All => true,
Ignore::None => false,

View File

@ -553,7 +553,7 @@ fn run_test_in_process(
Err(e) => calc_result(&desc, Err(e.as_ref()), &time_opts, &exec_time),
};
let stdout = data.lock().unwrap().to_vec();
let message = CompletedTest::new(desc.clone(), test_result, exec_time, stdout);
let message = CompletedTest::new(desc, test_result, exec_time, stdout);
monitor_ch.send(message).unwrap();
}
@ -602,7 +602,7 @@ fn spawn_test_subprocess(
(result, test_output, exec_time)
})();
let message = CompletedTest::new(desc.clone(), result, exec_time, test_output);
let message = CompletedTest::new(desc, result, exec_time, test_output);
monitor_ch.send(message).unwrap();
}