From 280231a5220cfa48c3c572e2cbe3e3c6f1214356 Mon Sep 17 00:00:00 2001 From: genusistimelord Date: Wed, 16 Aug 2023 09:17:08 -0400 Subject: [PATCH] run clippy to fix any issues --- src/native/modal.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/native/modal.rs b/src/native/modal.rs index e375596d..143a961a 100644 --- a/src/native/modal.rs +++ b/src/native/modal.rs @@ -136,11 +136,10 @@ where Renderer::Theme: StyleSheet, { fn children(&self) -> Vec { - if let Some(overlay) = &self.overlay { - vec![Tree::new(&self.underlay), Tree::new(overlay)] - } else { - vec![Tree::new(&self.underlay)] - } + self.overlay.as_ref().map_or_else( + || vec![Tree::new(&self.underlay)], + |overlay| vec![Tree::new(&self.underlay), Tree::new(overlay)], + ) } fn diff(&self, tree: &mut Tree) {