Use Option::and_then over manual match

master
Jonas Platte 2020-07-25 02:32:18 +02:00
parent 7aea6160c3
commit 14db34beee
No known key found for this signature in database
GPG Key ID: 7D261D771D915378
1 changed files with 3 additions and 4 deletions

View File

@ -1199,10 +1199,9 @@ impl BaseClient {
// send the `prev_content` field as part of the unsigned field. // send the `prev_content` field as part of the unsigned field.
if let AnyStrippedStateEvent::RoomMember(_) = &mut e { if let AnyStrippedStateEvent::RoomMember(_) = &mut e {
if let Some(raw_content) = stripped_deserialize_prev_content(event) { if let Some(raw_content) = stripped_deserialize_prev_content(event) {
let prev_content = match raw_content.prev_content { let prev_content = raw_content
Some(json) => json.deserialize().ok(), .prev_content
None => None, .and_then(|json| json.deserialize().ok());
};
self.emit_stripped_state_event( self.emit_stripped_state_event(
&room_id, &room_id,
&e, &e,