Auto-fix clippy::collapsible_if violations (#36428)

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-08-19 15:27:24 +02:00 committed by GitHub
parent 9e8ec72bd5
commit 8f567383e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
281 changed files with 6628 additions and 7089 deletions

View file

@ -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 => {

View file

@ -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

View file

@ -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 {

View file

@ -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?;
}
}
}