multi_buffer: Reduce RefCell::borrow_mut calls to the bare minimum (#40522)
Release Notes: - N/A *or* Added/Fixed/Improved ...
This commit is contained in:
@@ -797,7 +797,13 @@ async fn test_set_anchored_excerpts_for_path(cx: &mut TestAppContext) {
|
||||
let multibuffer = cx.new(|_| MultiBuffer::new(Capability::ReadWrite));
|
||||
let anchor_ranges_1 = multibuffer
|
||||
.update(cx, |multibuffer, cx| {
|
||||
multibuffer.set_anchored_excerpts_for_path(buffer_1.clone(), ranges_1, 2, cx)
|
||||
multibuffer.set_anchored_excerpts_for_path(
|
||||
PathKey::for_buffer(&buffer_1, cx),
|
||||
buffer_1.clone(),
|
||||
ranges_1,
|
||||
2,
|
||||
cx,
|
||||
)
|
||||
})
|
||||
.await;
|
||||
let snapshot_1 = multibuffer.update(cx, |multibuffer, cx| multibuffer.snapshot(cx));
|
||||
@@ -814,7 +820,13 @@ async fn test_set_anchored_excerpts_for_path(cx: &mut TestAppContext) {
|
||||
);
|
||||
let anchor_ranges_2 = multibuffer
|
||||
.update(cx, |multibuffer, cx| {
|
||||
multibuffer.set_anchored_excerpts_for_path(buffer_2.clone(), ranges_2, 2, cx)
|
||||
multibuffer.set_anchored_excerpts_for_path(
|
||||
PathKey::for_buffer(&buffer_2, cx),
|
||||
buffer_2.clone(),
|
||||
ranges_2,
|
||||
2,
|
||||
cx,
|
||||
)
|
||||
})
|
||||
.await;
|
||||
let snapshot_2 = multibuffer.update(cx, |multibuffer, cx| multibuffer.snapshot(cx));
|
||||
|
||||
Reference in New Issue
Block a user