Skip to content

Commit

Permalink
remove redundant clones, found by clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Jan 15, 2020
1 parent c74353c commit 312c3a0
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
2 changes: 0 additions & 2 deletions src/librustc_driver/pretty.rs
Expand Up @@ -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();
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_parse/parser/ty.rs
Expand Up @@ -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,
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_resolve/imports.rs
Expand Up @@ -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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/test.rs
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/libtest/lib.rs
Expand Up @@ -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();
}

Expand Down Expand Up @@ -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();
}

Expand Down

0 comments on commit 312c3a0

Please sign in to comment.