We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
LatestEventValue
Default
1 parent 5e94610 commit a7bef88Copy full SHA for a7bef88
crates/matrix-sdk/src/latest_events/latest_event.rs
@@ -91,9 +91,10 @@ impl LatestEvent {
91
}
92
93
/// A latest event value!
94
-#[derive(Debug, Clone)]
+#[derive(Debug, Default, Clone)]
95
pub enum LatestEventValue {
96
/// No value has been computed yet, or no candidate value was found.
97
+ #[default]
98
None,
99
100
/// A `m.room.message` event.
@@ -148,7 +149,7 @@ impl LatestEventValue {
148
149
room_event_cache
150
.rfind_map_event_in_memory_by(|event| find_and_map(event, power_levels))
151
.await
- .unwrap_or(LatestEventValue::None)
152
+ .unwrap_or_default()
153
154
155
0 commit comments