remove a few unnecessary muts

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-09-09 21:41:57 -04:00
parent 38552b36e9
commit cf9b72ce3f
3 changed files with 3 additions and 7 deletions

View file

@ -230,8 +230,7 @@ pub(crate) async fn create_room_route(
_ => RoomPreset::PrivateChat, // Room visibility should not be custom
});
let mut users = BTreeMap::new();
users.insert(sender_user.clone(), int!(100));
let mut users = BTreeMap::from_iter([(sender_user.clone(), int!(100))]);
if preset == RoomPreset::TrustedPrivateChat {
for invite_ in &body.invite {

View file

@ -101,8 +101,7 @@ pub async fn create_admin_room(services: &Services) -> Result<()> {
.await?;
// 3. Power levels
let mut users = BTreeMap::new();
users.insert(server_user.clone(), 100.into());
let users = BTreeMap::from_iter([(server_user.clone(), 100.into())]);
services
.rooms

View file

@ -86,9 +86,7 @@ impl super::Service {
.await?;
// Set power level
let mut users = BTreeMap::new();
users.insert(server_user.clone(), 100.into());
users.insert(user_id.to_owned(), 100.into());
let users = BTreeMap::from_iter([(server_user.clone(), 100.into()), (user_id.to_owned(), 100.into())]);
self.services
.timeline