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

@ -138,10 +138,10 @@ impl NotificationStore {
pub fn notification_for_id(&self, id: u64) -> Option<&NotificationEntry> {
let mut cursor = self.notifications.cursor::<NotificationId>(&());
cursor.seek(&NotificationId(id), Bias::Left);
if let Some(item) = cursor.item() {
if item.id == id {
return Some(item);
}
if let Some(item) = cursor.item()
&& item.id == id
{
return Some(item);
}
None
}
@ -229,25 +229,24 @@ impl NotificationStore {
mut cx: AsyncApp,
) -> Result<()> {
this.update(&mut cx, |this, cx| {
if let Some(notification) = envelope.payload.notification {
if let Some(rpc::Notification::ChannelMessageMention { message_id, .. }) =
if let Some(notification) = envelope.payload.notification
&& let Some(rpc::Notification::ChannelMessageMention { message_id, .. }) =
Notification::from_proto(&notification)
{
let fetch_message_task = this.channel_store.update(cx, |this, cx| {
this.fetch_channel_messages(vec![message_id], cx)
});
{
let fetch_message_task = this.channel_store.update(cx, |this, cx| {
this.fetch_channel_messages(vec![message_id], cx)
});
cx.spawn(async move |this, cx| {
let messages = fetch_message_task.await?;
this.update(cx, move |this, cx| {
for message in messages {
this.channel_messages.insert(message_id, message);
}
cx.notify();
})
cx.spawn(async move |this, cx| {
let messages = fetch_message_task.await?;
this.update(cx, move |this, cx| {
for message in messages {
this.channel_messages.insert(message_id, message);
}
cx.notify();
})
.detach_and_log_err(cx)
}
})
.detach_and_log_err(cx)
}
Ok(())
})?
@ -390,12 +389,12 @@ impl NotificationStore {
});
}
}
} else if let Some(new_notification) = &new_notification {
if is_new {
cx.emit(NotificationEvent::NewNotification {
entry: new_notification.clone(),
});
}
} else if let Some(new_notification) = &new_notification
&& is_new
{
cx.emit(NotificationEvent::NewNotification {
entry: new_notification.clone(),
});
}
if let Some(notification) = new_notification {