Use Option::and_then over manual match
This commit is contained in:
parent
7aea6160c3
commit
14db34beee
1 changed files with 3 additions and 4 deletions
|
@ -1199,10 +1199,9 @@ impl BaseClient {
|
|||
// send the `prev_content` field as part of the unsigned field.
|
||||
if let AnyStrippedStateEvent::RoomMember(_) = &mut e {
|
||||
if let Some(raw_content) = stripped_deserialize_prev_content(event) {
|
||||
let prev_content = match raw_content.prev_content {
|
||||
Some(json) => json.deserialize().ok(),
|
||||
None => None,
|
||||
};
|
||||
let prev_content = raw_content
|
||||
.prev_content
|
||||
.and_then(|json| json.deserialize().ok());
|
||||
self.emit_stripped_state_event(
|
||||
&room_id,
|
||||
&e,
|
||||
|
|
Loading…
Reference in a new issue