editor: Shrink DisplayMapSnapshot from 824 to 256 bytes (#39568)
We have unnecessary clones for the fields here as most of the snapshots contain the others hierarchically. Release Notes: - N/A *or* Added/Fixed/Improved ...
This commit is contained in:
@@ -504,7 +504,7 @@ impl EditorTestContext {
|
||||
.map(|h| h.1.clone())
|
||||
.unwrap_or_default()
|
||||
.iter()
|
||||
.map(|range| range.to_offset(&snapshot.buffer_snapshot))
|
||||
.map(|range| range.to_offset(&snapshot.buffer_snapshot()))
|
||||
.collect()
|
||||
});
|
||||
assert_set_eq!(actual_ranges, expected_ranges);
|
||||
@@ -519,7 +519,7 @@ impl EditorTestContext {
|
||||
.map(|ranges| ranges.as_ref().clone().1)
|
||||
.unwrap_or_default()
|
||||
.into_iter()
|
||||
.map(|range| range.to_offset(&snapshot.buffer_snapshot))
|
||||
.map(|range| range.to_offset(&snapshot.buffer_snapshot()))
|
||||
.collect();
|
||||
assert_set_eq!(actual_ranges, expected_ranges);
|
||||
}
|
||||
@@ -579,7 +579,7 @@ pub fn assert_state_with_diff(
|
||||
) {
|
||||
let (snapshot, selections) = editor.update_in(cx, |editor, window, cx| {
|
||||
(
|
||||
editor.snapshot(window, cx).buffer_snapshot.clone(),
|
||||
editor.snapshot(window, cx).buffer_snapshot().clone(),
|
||||
editor.selections.ranges::<usize>(cx),
|
||||
)
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user