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
2025-05-26 23:04:31 -04:00
committed by GitHub
parent 4a577fff4a
commit c208532693
79 changed files with 319 additions and 306 deletions
+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;