Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Use `children` instead of `when`

Marshall Bowerscbdd1d6d6c1e
diff --git a/crates/ui2/src/components/list.rs b/crates/ui2/src/components/list.rs
index e2c30b6bfa3..f664bbb547c 100644
--- a/crates/ui2/src/components/list.rs
+++ b/crates/ui2/src/components/list.rs
@@ -514,9 +514,11 @@ impl<S: 'static + Send + Sync> ListDetailsEntry<S> {
.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