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:
parent
cf7c64d77f
commit
7bdc99abc1
306 changed files with 805 additions and 1102 deletions
|
@ -83,7 +83,7 @@ impl RenderOnce for ThemeControl {
|
|||
|
||||
DropdownMenu::new(
|
||||
"theme",
|
||||
value.clone(),
|
||||
value,
|
||||
ContextMenu::build(window, cx, |mut menu, _, cx| {
|
||||
let theme_registry = ThemeRegistry::global(cx);
|
||||
|
||||
|
@ -204,7 +204,7 @@ impl RenderOnce for UiFontFamilyControl {
|
|||
.child(Icon::new(IconName::Font))
|
||||
.child(DropdownMenu::new(
|
||||
"ui-font-family",
|
||||
value.clone(),
|
||||
value,
|
||||
ContextMenu::build(window, cx, |mut menu, _, cx| {
|
||||
let font_family_cache = FontFamilyCache::global(cx);
|
||||
|
||||
|
|
|
@ -1182,8 +1182,8 @@ impl KeymapEditor {
|
|||
return;
|
||||
};
|
||||
|
||||
telemetry::event!("Keybinding Context Copied", context = context.clone());
|
||||
cx.write_to_clipboard(gpui::ClipboardItem::new_string(context.clone()));
|
||||
telemetry::event!("Keybinding Context Copied", context = context);
|
||||
cx.write_to_clipboard(gpui::ClipboardItem::new_string(context));
|
||||
}
|
||||
|
||||
fn copy_action_to_clipboard(
|
||||
|
@ -1199,8 +1199,8 @@ impl KeymapEditor {
|
|||
return;
|
||||
};
|
||||
|
||||
telemetry::event!("Keybinding Action Copied", action = action.clone());
|
||||
cx.write_to_clipboard(gpui::ClipboardItem::new_string(action.clone()));
|
||||
telemetry::event!("Keybinding Action Copied", action = action);
|
||||
cx.write_to_clipboard(gpui::ClipboardItem::new_string(action));
|
||||
}
|
||||
|
||||
fn toggle_conflict_filter(
|
||||
|
@ -1464,7 +1464,7 @@ impl RenderOnce for KeybindContextString {
|
|||
fn render(self, _window: &mut Window, cx: &mut App) -> impl IntoElement {
|
||||
match self {
|
||||
KeybindContextString::Global => {
|
||||
muted_styled_text(KeybindContextString::GLOBAL.clone(), cx).into_any_element()
|
||||
muted_styled_text(KeybindContextString::GLOBAL, cx).into_any_element()
|
||||
}
|
||||
KeybindContextString::Local(name, language) => {
|
||||
SyntaxHighlightedText::new(name, language).into_any_element()
|
||||
|
@ -1748,7 +1748,7 @@ impl Render for KeymapEditor {
|
|||
} else {
|
||||
const NULL: SharedString =
|
||||
SharedString::new_static("<null>");
|
||||
muted_styled_text(NULL.clone(), cx)
|
||||
muted_styled_text(NULL, cx)
|
||||
.into_any_element()
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue