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
|
@ -242,7 +242,7 @@ impl ProjectDiff {
|
|||
TRACKED_NAMESPACE
|
||||
};
|
||||
|
||||
let path_key = PathKey::namespaced(namespace, entry.repo_path.0.clone());
|
||||
let path_key = PathKey::namespaced(namespace, entry.repo_path.0);
|
||||
|
||||
self.move_to_path(path_key, window, cx)
|
||||
}
|
||||
|
@ -448,10 +448,10 @@ impl ProjectDiff {
|
|||
let diff = diff.read(cx);
|
||||
let diff_hunk_ranges = diff
|
||||
.hunks_intersecting_range(Anchor::MIN..Anchor::MAX, &snapshot, cx)
|
||||
.map(|diff_hunk| diff_hunk.buffer_range.clone());
|
||||
.map(|diff_hunk| diff_hunk.buffer_range);
|
||||
let conflicts = conflict_addon
|
||||
.conflict_set(snapshot.remote_id())
|
||||
.map(|conflict_set| conflict_set.read(cx).snapshot().conflicts.clone())
|
||||
.map(|conflict_set| conflict_set.read(cx).snapshot().conflicts)
|
||||
.unwrap_or_default();
|
||||
let conflicts = conflicts.iter().map(|conflict| conflict.range.clone());
|
||||
|
||||
|
@ -737,7 +737,7 @@ impl Render for ProjectDiff {
|
|||
} else {
|
||||
None
|
||||
};
|
||||
let keybinding_focus_handle = self.focus_handle(cx).clone();
|
||||
let keybinding_focus_handle = self.focus_handle(cx);
|
||||
el.child(
|
||||
v_flex()
|
||||
.gap_1()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue