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
|
@ -35,7 +35,7 @@ impl ModalContainerProperties {
|
|||
|
||||
// Calculate width based on character width
|
||||
let mut modal_width = 460.0;
|
||||
let style = window.text_style().clone();
|
||||
let style = window.text_style();
|
||||
let font_id = window.text_system().resolve_font(&style.font());
|
||||
let font_size = style.font_size.to_pixels(window.rem_size());
|
||||
|
||||
|
@ -179,7 +179,7 @@ impl CommitModal {
|
|||
|
||||
let commit_editor = git_panel.update(cx, |git_panel, cx| {
|
||||
git_panel.set_modal_open(true, cx);
|
||||
let buffer = git_panel.commit_message_buffer(cx).clone();
|
||||
let buffer = git_panel.commit_message_buffer(cx);
|
||||
let panel_editor = git_panel.commit_editor.clone();
|
||||
let project = git_panel.project.clone();
|
||||
|
||||
|
@ -285,7 +285,7 @@ impl CommitModal {
|
|||
Some(ContextMenu::build(window, cx, |context_menu, _, _| {
|
||||
context_menu
|
||||
.when_some(keybinding_target.clone(), |el, keybinding_target| {
|
||||
el.context(keybinding_target.clone())
|
||||
el.context(keybinding_target)
|
||||
})
|
||||
.when(has_previous_commit, |this| {
|
||||
this.toggleable_entry(
|
||||
|
@ -482,7 +482,7 @@ impl CommitModal {
|
|||
}),
|
||||
self.render_git_commit_menu(
|
||||
ElementId::Name(format!("split-button-right-{}", commit_label).into()),
|
||||
Some(focus_handle.clone()),
|
||||
Some(focus_handle),
|
||||
)
|
||||
.into_any_element(),
|
||||
)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue