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

@@ -50,10 +50,10 @@ pub(super) async fn startup_execute(&self) -> Result {
sleep(Duration::from_millis(500)).await;
for (i, command) in commands.iter().enumerate() {
if let Err(e) = self.execute_command(i, command.clone()).await {
if !errors {
return Err(e);
}
if let Err(e) = self.execute_command(i, command.clone()).await
&& !errors
{
return Err(e);
}
tokio::task::yield_now().await;
@@ -92,10 +92,10 @@ pub(super) async fn signal_execute(&self) -> Result {
.admin_execute_errors_ignore;
for (i, command) in commands.iter().enumerate() {
if let Err(e) = self.execute_command(i, command.clone()).await {
if !ignore_errors {
return Err(e);
}
if let Err(e) = self.execute_command(i, command.clone()).await
&& !ignore_errors
{
return Err(e);
}
tokio::task::yield_now().await;

View File

@@ -132,15 +132,14 @@ pub async fn make_user_admin(&self, user_id: &UserId) -> Result {
.admin_room_tag
.as_str();
if !room_tag.is_empty() {
if let Err(e) = self
if !room_tag.is_empty()
&& let Err(e) = self
.services
.account_data
.set_room_tag(user_id, &room_id, room_tag.into(), None)
.await
{
error!(?room_id, ?user_id, ?room_tag, "Failed to set tag for admin grant: {e}");
}
{
error!(?room_id, ?user_id, ?room_tag, "Failed to set tag for admin grant: {e}");
}
if self.services.server.config.admin_room_notices {