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:
Lukas Wirth
2025-10-17 18:17:34 +00:00
committed by GitHub
parent 1fbe1e3512
commit 27dcdb5841
9 changed files with 283 additions and 295 deletions
+14 -2
View File
@@ -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));