fix and enable collapsible_if lint
Signed-off-by: June Strawberry <june@vern.cc>
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user