remove various unnecessary qualifications
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
aedb5966fe
commit
7c1624931d
17 changed files with 39 additions and 42 deletions
|
@ -367,7 +367,7 @@ impl Service {
|
|||
|
||||
// The original create event must be in the auth events
|
||||
if !matches!(
|
||||
auth_events.get(&(StateEventType::RoomCreate, "".to_owned())).map(std::convert::AsRef::as_ref),
|
||||
auth_events.get(&(StateEventType::RoomCreate, "".to_owned())).map(AsRef::as_ref),
|
||||
Some(_) | None
|
||||
) {
|
||||
return Err(Error::BadRequest(
|
||||
|
@ -623,8 +623,7 @@ impl Service {
|
|||
.get_shortstatekey(&StateEventType::RoomCreate, "")?
|
||||
.expect("Room exists");
|
||||
|
||||
if state.get(&create_shortstatekey).map(std::convert::AsRef::as_ref) != Some(&create_event.event_id)
|
||||
{
|
||||
if state.get(&create_shortstatekey).map(AsRef::as_ref) != Some(&create_event.event_id) {
|
||||
return Err(Error::bad_database("Incoming event refers to wrong create event."));
|
||||
}
|
||||
|
||||
|
|
|
@ -57,11 +57,11 @@ impl Service {
|
|||
let mut results = Vec::new();
|
||||
|
||||
while let Some(current_room) = {
|
||||
while stack.last().map_or(false, std::vec::Vec::is_empty) {
|
||||
while stack.last().map_or(false, Vec::is_empty) {
|
||||
stack.pop();
|
||||
}
|
||||
if !stack.is_empty() {
|
||||
stack.last_mut().and_then(std::vec::Vec::pop)
|
||||
stack.last_mut().and_then(Vec::pop)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
@ -402,7 +402,7 @@ impl Service {
|
|||
match join_rule {
|
||||
JoinRule::Restricted(r) => {
|
||||
for rule in &r.allow {
|
||||
if let join_rules::AllowRule::RoomMembership(rm) = rule {
|
||||
if let AllowRule::RoomMembership(rm) = rule {
|
||||
if let Ok(true) = services().rooms.state_cache.is_joined(sender_user, &rm.room_id) {
|
||||
return Ok(true);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue