Change summary
crates/editor/src/split.rs | 6 +++---
crates/multi_buffer/src/multi_buffer.rs | 3 +--
2 files changed, 4 insertions(+), 5 deletions(-)
Detailed changes
@@ -415,11 +415,11 @@ impl SplittableEditor {
let secondary_snapshot = secondary.multibuffer.read(cx).snapshot(cx);
let primary_diff_hunks = primary_snapshot
.diff_hunks()
- .map(|hunk| hunk.diff_base_byte_range.clone())
+ .map(|hunk| hunk.diff_base_byte_range)
.collect::<Vec<_>>();
let secondary_diff_hunks = secondary_snapshot
.diff_hunks()
- .map(|hunk| hunk.diff_base_byte_range.clone())
+ .map(|hunk| hunk.diff_base_byte_range)
.collect::<Vec<_>>();
pretty_assertions::assert_eq!(primary_diff_hunks, secondary_diff_hunks);
@@ -734,7 +734,7 @@ mod tests {
let diff_snapshot = diff.read(cx).snapshot(cx);
let ranges = diff_snapshot
.hunks(&buffer_snapshot)
- .map(|hunk| hunk.range.clone())
+ .map(|hunk| hunk.range)
.collect::<Vec<_>>();
let path = PathKey::for_buffer(&buffer, cx);
editor.set_excerpts_for_path(path, buffer, ranges, 2, diff, cx);
@@ -2552,8 +2552,7 @@ impl MultiBuffer {
text::Anchor::min_max_range_for_buffer(buffer_id),
cx,
);
- self.diffs
- .insert(buffer_id, DiffState::new(diff.clone(), cx));
+ self.diffs.insert(buffer_id, DiffState::new(diff, cx));
}
pub fn add_inverted_diff(