Skip to content

remove redundant clones, found by clippy #68252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/librustc_driver/pretty.rs
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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