From 48d96779590ed145e4301df5a7786937536fcccd Mon Sep 17 00:00:00 2001
From: Jason Volk <jason@zemos.net>
Date: Sun, 16 Jun 2024 00:09:32 +0000
Subject: [PATCH] rustfmt nightly/stable compats

Signed-off-by: Jason Volk <jason@zemos.net>
---
 src/admin/room/room_moderation_commands.rs | 29 +++++++++++-----------
 src/core/config/proxy.rs                   |  4 +--
 2 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/src/admin/room/room_moderation_commands.rs b/src/admin/room/room_moderation_commands.rs
index 5989ff73..1876bf5e 100644
--- a/src/admin/room/room_moderation_commands.rs
+++ b/src/admin/room/room_moderation_commands.rs
@@ -111,15 +111,15 @@ async fn ban_room(
 				user.ok().filter(|local_user| {
 					user_is_local(local_user)
 								// additional wrapped check here is to avoid adding remote users
-								// who are in the admin room to the list of local users (would fail auth check)
+								// who are in the admin room to the list of local users (would
+								// fail auth check)
 								&& (user_is_local(local_user)
+									// since this is a force operation, assume user is an admin
+									// if somehow this fails
 									&& services()
 										.users
 										.is_admin(local_user)
-										.unwrap_or(true)) // since this is a force
-					 // operation, assume user
-					 // is an admin if somehow
-					 // this fails
+										.unwrap_or(true))
 				})
 			})
 			.collect::<Vec<OwnedUserId>>()
@@ -311,19 +311,17 @@ async fn ban_list_of_rooms(body: Vec<&str>, force: bool, disable_federation: boo
 				.filter_map(|user| {
 					user.ok().filter(|local_user| {
 						local_user.server_name() == services().globals.server_name()
-										// additional wrapped check here is to avoid adding remote users
-										// who are in the admin room to the list of local users (would fail auth check)
+										// additional wrapped check here is to avoid adding remote
+										// users who are in the admin room to the list of local
+										// users (would fail auth check)
 										&& (local_user.server_name()
 											== services().globals.server_name()
+											// since this is a force operation, assume user is an
+											// admin if somehow this fails
 											&& services()
 												.users
 												.is_admin(local_user)
-												.unwrap_or(true)) // since this is a
-						 // force operation,
-						 // assume user is
-						 // an admin if
-						 // somehow this
-						 // fails
+												.unwrap_or(true))
 					})
 				})
 				.collect::<Vec<OwnedUserId>>()
@@ -344,8 +342,9 @@ async fn ban_list_of_rooms(body: Vec<&str>, force: bool, disable_federation: boo
 				.filter_map(|user| {
 					user.ok().filter(|local_user| {
 						local_user.server_name() == services().globals.server_name()
-										// additional wrapped check here is to avoid adding remote users
-										// who are in the admin room to the list of local users (would fail auth check)
+										// additional wrapped check here is to avoid adding remote
+										// users who are in the admin room to the list of local
+										// users (would fail auth check)
 										&& (local_user.server_name()
 											== services().globals.server_name()
 											&& !services()
diff --git a/src/core/config/proxy.rs b/src/core/config/proxy.rs
index a2d64fa6..d823e5e4 100644
--- a/src/core/config/proxy.rs
+++ b/src/core/config/proxy.rs
@@ -47,8 +47,8 @@ impl ProxyConfig {
 				url,
 			} => Some(Proxy::all(url)?),
 			Self::ByDomain(proxies) => Some(Proxy::custom(move |url| {
-				proxies.iter().find_map(|proxy| proxy.for_url(url)).cloned() // first matching
-				                                             // proxy
+				// first matching proxy
+				proxies.iter().find_map(|proxy| proxy.for_url(url)).cloned()
 			})),
 		})
 	}