From a3707b1a3a011578fccad56f9a268a7fa887db38 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Tue, 31 Aug 2021 19:02:03 +0200 Subject: [PATCH] state-res: Remove pointless .unwrap() --- crates/ruma-state-res/src/lib.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/crates/ruma-state-res/src/lib.rs b/crates/ruma-state-res/src/lib.rs index 7cc03ead..75517d9f 100644 --- a/crates/ruma-state-res/src/lib.rs +++ b/crates/ruma-state-res/src/lib.rs @@ -614,9 +614,7 @@ impl StateResolution { F: Fn(&EventId) -> Option>, { let mut state = vec![event_id.clone()]; - while !state.is_empty() { - // We just checked if it was empty so unwrap is fine - let eid = state.pop().unwrap(); + while let Some(eid) = state.pop() { graph.entry(eid.clone()).or_insert(hashset![]); // Prefer the store to event as the store filters dedups the events for aid in &fetch_event(&eid).map(|ev| ev.auth_events()).unwrap_or_default() {