From cbdd1d6d6c1e4974f4c8b8949c877a5eb54b5dad Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Fri, 20 Oct 2023 16:30:52 -0400 Subject: [PATCH] Use `children` instead of `when` --- crates/ui2/src/components/list.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/ui2/src/components/list.rs b/crates/ui2/src/components/list.rs index e2c30b6bfa348be5be47aba18eb76f65c3c47823..f664bbb547cd2996ca211cd2cc4d644cea875ea4 100644 --- a/crates/ui2/src/components/list.rs +++ b/crates/ui2/src/components/list.rs @@ -514,9 +514,11 @@ impl ListDetailsEntry { .w_full() .line_height(relative(1.2)) .child(Label::new(self.label.clone()).color(label_color)) - .when(self.meta.is_some(), |this| { - this.child(Label::new(self.meta.clone().unwrap()).color(LabelColor::Muted)) - }) + .children( + self.meta + .take() + .map(|meta| Label::new(meta).color(LabelColor::Muted)), + ) .child( h_stack().gap_1().justify_end().children( self.actions