From 789b5d9f2be677e3d081ac7a921267f3f4f97196 Mon Sep 17 00:00:00 2001 From: Richard Barnes Date: Mon, 15 Jul 2024 20:56:31 -0400 Subject: [PATCH] if let --- mls-rs/src/group/mod.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mls-rs/src/group/mod.rs b/mls-rs/src/group/mod.rs index eebf92f2..9383ffcc 100644 --- a/mls-rs/src/group/mod.rs +++ b/mls-rs/src/group/mod.rs @@ -2028,13 +2028,14 @@ where // If the current leaf node contains an epoch value, delete any cached state for // updates from prior epochs. - self.current_user_leaf_node()? + let epoch_ext = self + .current_user_leaf_node()? .extensions - .get_as::()? - .map(|epoch_ext| { - self.pending_updates - .retain(|_pk, upd| upd.epoch >= epoch_ext.epoch); - }); + .get_as::()?; + if let Some(epoch_ext) = epoch_ext { + self.pending_updates + .retain(|_pk, upd| upd.epoch >= epoch_ext.epoch); + } } self.pending_commit = None;