fix and enable collapsible_if lint

Signed-off-by: June Strawberry <june@vern.cc>
This commit is contained in:
June Strawberry
2026-01-15 17:39:33 -05:00
parent fb102f0e0a
commit 04e66a03d3
54 changed files with 453 additions and 504 deletions

View File

@@ -325,15 +325,15 @@ impl Service {
}
// Add EDU's into the transaction
if let Destination::Federation(server_name) = dest {
if let Ok((select_edus, last_count)) = self.select_edus(server_name).await {
debug_assert!(select_edus.len() <= EDU_LIMIT, "exceeded edus limit");
let select_edus = select_edus.into_iter().map(SendingEvent::Edu);
if let Destination::Federation(server_name) = dest
&& let Ok((select_edus, last_count)) = self.select_edus(server_name).await
{
debug_assert!(select_edus.len() <= EDU_LIMIT, "exceeded edus limit");
let select_edus = select_edus.into_iter().map(SendingEvent::Edu);
events.extend(select_edus);
self.db
.set_latest_educount(server_name, last_count);
}
events.extend(select_edus);
self.db
.set_latest_educount(server_name, last_count);
}
Ok(Some(events))
@@ -735,12 +735,11 @@ impl Service {
}
},
| SendingEvent::Edu(edu) =>
if appservice.receive_ephemeral {
if let Ok(edu) =
if appservice.receive_ephemeral
&& let Ok(edu) =
serde_json::from_slice(edu).and_then(|edu| Raw::new(&edu))
{
edu_jsons.push(edu);
}
{
edu_jsons.push(edu);
},
| SendingEvent::Flush => {}, // flush only; no new content
}