Use read-only access methods for read-only entity operations (#31479)

Another follow-up to #31254

Release Notes:

- N/A
This commit is contained in:
Joseph T. Lyons authored and GitHub committed 2025-05-26 23:04:31 -04:00
1 parent b58ea98473
commit 7b39f232ec
79 files changed
+319 -306

No files matched your search

+4 -4
View File
@@ -1394,7 +1394,7 @@ mod tests {
);
cx.run_until_parked();
let editor = diff.update(cx, |diff, _| diff.editor.clone());
let editor = diff.read_with(cx, |diff, _| diff.editor.clone());
assert_state_with_diff(
&editor,
cx,
@@ -1526,7 +1526,7 @@ mod tests {
);
cx.run_until_parked();
let diff_editor = diff.update(cx, |diff, _| diff.editor.clone());
let diff_editor = diff.read_with(cx, |diff, _| diff.editor.clone());
assert_state_with_diff(
&diff_editor,
@@ -1642,7 +1642,7 @@ mod tests {
workspace.active_item_as::<ProjectDiff>(cx).unwrap()
});
cx.focus(&item);
let editor = item.update(cx, |item, _| item.editor.clone());
let editor = item.read_with(cx, |item, _| item.editor.clone());
let mut cx = EditorTestContext::for_editor_in(editor, cx).await;
@@ -1756,7 +1756,7 @@ mod tests {
workspace.active_item_as::<ProjectDiff>(cx).unwrap()
});
cx.focus(&item);
let editor = item.update(cx, |item, _| item.editor.clone());
let editor = item.read_with(cx, |item, _| item.editor.clone());
let mut cx = EditorTestContext::for_editor_in(editor, cx).await;