Run cargo fmt and apply clippy lints.

This commit is contained in:
Denis Kasak 2020-06-20 12:57:59 +02:00
parent 1174ccfc89
commit c0c02baffc
2 changed files with 3 additions and 5 deletions

View file

@ -100,7 +100,7 @@ fn hoist_room_event_prev_content(event: &mut EventJson<RoomEvent>) -> Option<Eve
let mut ev = event.deserialize().ok()?;
match &mut ev {
RoomEvent::RoomMember(ref mut member) if member.prev_content.is_none() => {
if let Some(prev) = prev_content.deserialize().ok() {
if let Ok(prev) = prev_content.deserialize() {
member.prev_content = Some(prev)
}
@ -123,7 +123,7 @@ fn hoist_state_event_prev_content(event: &EventJson<StateEvent>) -> Option<Event
let mut ev = event.deserialize().ok()?;
match &mut ev {
StateEvent::RoomMember(ref mut member) if member.prev_content.is_none() => {
if let Some(prev) = prev_content.deserialize().ok() {
if let Ok(prev) = prev_content.deserialize() {
member.prev_content = Some(prev)
}

View file

@ -589,9 +589,7 @@ impl Room {
// TODO: This would not be handled correctly as all the MemberEvents have the `prev_content`
// inside of `unsigned` field.
match event.membership_change() {
Invited | Joined => {
self.add_member(event)
}
Invited | Joined => self.add_member(event),
Kicked | Banned | KickedAndBanned | InvitationRejected | Left => {
self.remove_member(event)
}