Use read() over read_with() to improve readability in simple cases (#31455)

Follow up to: #31263 

Release Notes:

- N/A
This commit is contained in:
Joseph T. Lyons 2025-05-26 16:14:07 -04:00 committed by GitHub
parent 5bafb2b160
commit 534bb0620d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 80 additions and 94 deletions

View file

@ -1185,9 +1185,10 @@ impl MessageEditor {
fn reload_context(&mut self, cx: &mut Context<Self>) -> Task<Option<ContextLoadResult>> {
let load_task = cx.spawn(async move |this, cx| {
let Ok(load_task) = this.update(cx, |this, cx| {
let new_context = this.context_store.read_with(cx, |context_store, cx| {
context_store.new_context_for_thread(this.thread.read(cx), None)
});
let new_context = this
.context_store
.read(cx)
.new_context_for_thread(this.thread.read(cx), None);
load_context(new_context, &this.project, &this.prompt_store, cx)
}) else {
return;