Fix clippy::redundant_clone lint violations (#36558)

This removes around 900 unnecessary clones, ranging from cloning a few
ints all the way to large data structures and images.

A lot of these were fixed using `cargo clippy --fix --workspace
--all-targets`, however it often breaks other lints and needs to be run
again. This was then followed up with some manual fixing.

I understand this is a large diff, but all the changes are pretty
trivial. Rust is doing some heavy lifting here for us. Once I get it up
to speed with main, I'd appreciate this getting merged rather sooner
than later.

Release Notes:

- N/A
This commit is contained in:
tidely 2025-08-20 13:20:13 +03:00 committed by GitHub
parent cf7c64d77f
commit 7bdc99abc1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
306 changed files with 805 additions and 1102 deletions

View file

@ -237,11 +237,11 @@ impl HeadlessProject {
session.add_entity_message_handler(BufferStore::handle_close_buffer);
session.add_request_handler(
extensions.clone().downgrade(),
extensions.downgrade(),
HeadlessExtensionStore::handle_sync_extensions,
);
session.add_request_handler(
extensions.clone().downgrade(),
extensions.downgrade(),
HeadlessExtensionStore::handle_install_extension,
);

View file

@ -160,7 +160,7 @@ fn init_panic_hook(session_id: String) {
let panic_data = telemetry_events::Panic {
thread: thread_name.into(),
payload: payload.clone(),
payload,
location_data: info.location().map(|location| LocationData {
file: location.file().into(),
line: location.line(),
@ -799,7 +799,6 @@ fn initialize_settings(
watch_config_file(cx.background_executor(), fs, paths::settings_file().clone());
handle_settings_file_changes(user_settings_file_rx, cx, {
let session = session.clone();
move |err, _cx| {
if let Some(e) = err {
log::info!("Server settings failed to change: {}", e);