Use Option::and_then over manual match
parent
7aea6160c3
commit
14db34beee
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue