Run cargo fmt and apply clippy lints.
parent
1174ccfc89
commit
c0c02baffc
|
@ -100,7 +100,7 @@ fn hoist_room_event_prev_content(event: &mut EventJson<RoomEvent>) -> Option<Eve
|
||||||
let mut ev = event.deserialize().ok()?;
|
let mut ev = event.deserialize().ok()?;
|
||||||
match &mut ev {
|
match &mut ev {
|
||||||
RoomEvent::RoomMember(ref mut member) if member.prev_content.is_none() => {
|
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)
|
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()?;
|
let mut ev = event.deserialize().ok()?;
|
||||||
match &mut ev {
|
match &mut ev {
|
||||||
StateEvent::RoomMember(ref mut member) if member.prev_content.is_none() => {
|
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)
|
member.prev_content = Some(prev)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -589,9 +589,7 @@ impl Room {
|
||||||
// TODO: This would not be handled correctly as all the MemberEvents have the `prev_content`
|
// TODO: This would not be handled correctly as all the MemberEvents have the `prev_content`
|
||||||
// inside of `unsigned` field.
|
// inside of `unsigned` field.
|
||||||
match event.membership_change() {
|
match event.membership_change() {
|
||||||
Invited | Joined => {
|
Invited | Joined => self.add_member(event),
|
||||||
self.add_member(event)
|
|
||||||
}
|
|
||||||
Kicked | Banned | KickedAndBanned | InvitationRejected | Left => {
|
Kicked | Banned | KickedAndBanned | InvitationRejected | Left => {
|
||||||
self.remove_member(event)
|
self.remove_member(event)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue