summaryrefslogtreecommitdiff
path: root/src/api/client_server/room.rs
diff options
context:
space:
mode:
authorNyaaori <+@nyaaori.cat>2022-10-10 14:09:11 +0200
committerNyaaori <+@nyaaori.cat>2022-10-10 14:09:11 +0200
commitf430b874598f4262e5af5ecee8dd396e317a1e87 (patch)
tree32544596835883720a8412b1618d52b82e78b05f /src/api/client_server/room.rs
parentca82b2940d9241b99e694f3c8d597feb5bf1bbc0 (diff)
downloadconduit-f430b874598f4262e5af5ecee8dd396e317a1e87.zip
cargo clippy
Diffstat (limited to 'src/api/client_server/room.rs')
-rw-r--r--src/api/client_server/room.rs19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/api/client_server/room.rs b/src/api/client_server/room.rs
index 43b2e8e..097f0e1 100644
--- a/src/api/client_server/room.rs
+++ b/src/api/client_server/room.rs
@@ -1,8 +1,6 @@
use crate::{
api::client_server::invite_helper, service::pdu::PduBuilder, services, Error, Result, Ruma,
};
-use ruma::serde::JsonObject;
-use ruma::OwnedRoomAliasId;
use ruma::{
api::client::{
error::ErrorKind,
@@ -23,7 +21,9 @@ use ruma::{
},
RoomEventType, StateEventType,
},
- int, CanonicalJsonObject, RoomAliasId, RoomId,
+ int,
+ serde::JsonObject,
+ CanonicalJsonObject, OwnedRoomAliasId, RoomAliasId, RoomId,
};
use serde_json::{json, value::to_raw_value};
use std::{cmp::max, collections::BTreeMap, sync::Arc};
@@ -213,14 +213,11 @@ pub async fn create_room_route(
// 3. Power levels
// Figure out preset. We need it for preset specific events
- let preset = body
- .preset
- .clone()
- .unwrap_or_else(|| match &body.visibility {
- room::Visibility::Private => RoomPreset::PrivateChat,
- room::Visibility::Public => RoomPreset::PublicChat,
- _ => RoomPreset::PrivateChat, // Room visibility should not be custom
- });
+ let preset = body.preset.clone().unwrap_or(match &body.visibility {
+ room::Visibility::Private => RoomPreset::PrivateChat,
+ room::Visibility::Public => RoomPreset::PublicChat,
+ _ => RoomPreset::PrivateChat, // Room visibility should not be custom
+ });
let mut users = BTreeMap::new();
users.insert(sender_user.clone(), int!(100));