Use read-only access methods for read-only entity operations (#31254)
This PR replaces some `update()` calls with either `read()` or `read_with()` when the `update()` call performed read-only operations on the entity. Many more likely exist, will follow-up with more PRs. Release Notes: - N/A
This commit is contained in:
parent
508ccde363
commit
f435304209
11 changed files with 20 additions and 20 deletions
|
@ -33,7 +33,7 @@ async fn test_handle_output_event(executor: BackgroundExecutor, cx: &mut TestApp
|
|||
.unwrap();
|
||||
|
||||
let session = start_debug_session(&workspace, cx, |_| {}).unwrap();
|
||||
let client = session.update(cx, |session, _| session.adapter_client().unwrap());
|
||||
let client = session.read_with(cx, |session, _| session.adapter_client().unwrap());
|
||||
|
||||
client.on_request::<StackTrace, _>(move |_, _| {
|
||||
Ok(dap::StackTraceResponse {
|
||||
|
|
|
@ -1015,7 +1015,7 @@ async fn test_debug_panel_item_thread_status_reset_on_failure(
|
|||
cx.run_until_parked();
|
||||
|
||||
let running_state = active_debug_session_panel(workspace, cx)
|
||||
.update(cx, |item, _| item.running_state().clone());
|
||||
.read_with(cx, |item, _| item.running_state().clone());
|
||||
|
||||
cx.run_until_parked();
|
||||
let thread_id = ThreadId(1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue