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:
parent
5bafb2b160
commit
534bb0620d
9 changed files with 80 additions and 94 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue