assistant2: Add intermediate bindings to improve conditional readability (#22790)

This PR adds some intermediate bindings to the checks for if a
file/directory is already included to make the conditional a bit
clearer.

It wasn't immediately obvious what the boolean values corresponded to
when looking at it.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-01-07 14:42:38 -05:00 committed by GitHub
parent fffa40f973
commit c53615ff61
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View file

@ -188,7 +188,7 @@ impl PickerDelegate for DirectoryContextPickerDelegate {
}; };
let path = mat.path.clone(); let path = mat.path.clone();
if self let already_included = self
.context_store .context_store
.update(cx, |context_store, _cx| { .update(cx, |context_store, _cx| {
if let Some(context_id) = context_store.included_directory(&path) { if let Some(context_id) = context_store.included_directory(&path) {
@ -198,8 +198,8 @@ impl PickerDelegate for DirectoryContextPickerDelegate {
false false
} }
}) })
.unwrap_or(true) .unwrap_or(true);
{ if already_included {
return; return;
} }

View file

@ -202,7 +202,7 @@ impl PickerDelegate for FileContextPickerDelegate {
}; };
let path = mat.path.clone(); let path = mat.path.clone();
if self let already_included = self
.context_store .context_store
.update(cx, |context_store, _cx| { .update(cx, |context_store, _cx| {
match context_store.included_file(&path) { match context_store.included_file(&path) {
@ -214,8 +214,8 @@ impl PickerDelegate for FileContextPickerDelegate {
None => false, None => false,
} }
}) })
.unwrap_or(true) .unwrap_or(true);
{ if already_included {
return; return;
} }