Auto-fix clippy::collapsible_if violations (#36428)
Release Notes: - N/A
This commit is contained in:
parent
9e8ec72bd5
commit
8f567383e4
281 changed files with 6628 additions and 7089 deletions
|
@ -194,11 +194,11 @@ impl EmbeddingIndex {
|
|||
project::PathChange::Added
|
||||
| project::PathChange::Updated
|
||||
| project::PathChange::AddedOrUpdated => {
|
||||
if let Some(entry) = worktree.entry_for_id(*entry_id) {
|
||||
if entry.is_file() {
|
||||
let handle = entries_being_indexed.insert(entry.id);
|
||||
updated_entries_tx.send((entry.clone(), handle)).await?;
|
||||
}
|
||||
if let Some(entry) = worktree.entry_for_id(*entry_id)
|
||||
&& entry.is_file()
|
||||
{
|
||||
let handle = entries_being_indexed.insert(entry.id);
|
||||
updated_entries_tx.send((entry.clone(), handle)).await?;
|
||||
}
|
||||
}
|
||||
project::PathChange::Removed => {
|
||||
|
|
|
@ -384,10 +384,10 @@ impl ProjectIndex {
|
|||
cx: &App,
|
||||
) -> Option<Entity<WorktreeIndex>> {
|
||||
for index in self.worktree_indices.values() {
|
||||
if let WorktreeIndexHandle::Loaded { index, .. } = index {
|
||||
if index.read(cx).worktree().read(cx).id() == worktree_id {
|
||||
return Some(index.clone());
|
||||
}
|
||||
if let WorktreeIndexHandle::Loaded { index, .. } = index
|
||||
&& index.read(cx).worktree().read(cx).id() == worktree_id
|
||||
{
|
||||
return Some(index.clone());
|
||||
}
|
||||
}
|
||||
None
|
||||
|
|
|
@ -174,14 +174,13 @@ impl SemanticDb {
|
|||
file_content[start_line_byte_offset..end_line_byte_offset].to_string();
|
||||
LineEnding::normalize(&mut excerpt_content);
|
||||
|
||||
if let Some(prev_result) = loaded_results.last_mut() {
|
||||
if prev_result.full_path == full_path {
|
||||
if *prev_result.row_range.end() + 1 == start_row {
|
||||
prev_result.row_range = *prev_result.row_range.start()..=end_row;
|
||||
prev_result.excerpt_content.push_str(&excerpt_content);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if let Some(prev_result) = loaded_results.last_mut()
|
||||
&& prev_result.full_path == full_path
|
||||
&& *prev_result.row_range.end() + 1 == start_row
|
||||
{
|
||||
prev_result.row_range = *prev_result.row_range.start()..=end_row;
|
||||
prev_result.excerpt_content.push_str(&excerpt_content);
|
||||
continue;
|
||||
}
|
||||
|
||||
loaded_results.push(LoadedSearchResult {
|
||||
|
|
|
@ -379,18 +379,14 @@ impl SummaryIndex {
|
|||
| project::PathChange::Added
|
||||
| project::PathChange::Updated
|
||||
| project::PathChange::AddedOrUpdated => {
|
||||
if let Some(entry) = worktree.entry_for_id(*entry_id) {
|
||||
if entry.is_file() {
|
||||
let needs_summary = Self::add_to_backlog(
|
||||
Arc::clone(&backlog),
|
||||
digest_db,
|
||||
&txn,
|
||||
entry,
|
||||
);
|
||||
if let Some(entry) = worktree.entry_for_id(*entry_id)
|
||||
&& entry.is_file()
|
||||
{
|
||||
let needs_summary =
|
||||
Self::add_to_backlog(Arc::clone(&backlog), digest_db, &txn, entry);
|
||||
|
||||
if !needs_summary.is_empty() {
|
||||
tx.send(needs_summary).await?;
|
||||
}
|
||||
if !needs_summary.is_empty() {
|
||||
tx.send(needs_summary).await?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue