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
|
@ -1730,9 +1730,8 @@ impl AssistantContext {
|
|||
merge_same_roles,
|
||||
} => {
|
||||
if !merge_same_roles && Some(role) != last_role {
|
||||
let offset = this.buffer.read_with(cx, |buffer, _cx| {
|
||||
insert_position.to_offset(buffer)
|
||||
});
|
||||
let buffer = this.buffer.read(cx);
|
||||
let offset = insert_position.to_offset(buffer);
|
||||
this.insert_message_at_offset(
|
||||
offset,
|
||||
role,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue