Detailed changes
@@ -250,7 +250,7 @@ impl<S: 'static> ListItem<S> {
pub struct ListEntry {
disclosure_control_style: DisclosureControlVisibility,
indent_level: u32,
- label: Option<Label>,
+ label: Label,
left_content: Option<LeftContent>,
variant: ListItemVariant,
size: ListEntrySize,
@@ -264,7 +264,7 @@ impl ListEntry {
Self {
disclosure_control_style: DisclosureControlVisibility::default(),
indent_level: 0,
- label: Some(label),
+ label,
variant: ListItemVariant::default(),
left_content: None,
size: ListEntrySize::default(),
@@ -412,7 +412,7 @@ impl ListEntry {
.relative()
.children(self.disclosure_control(cx))
.children(left_content)
- .children(self.label.take()),
+ .child(self.label),
)
}
}
@@ -38,7 +38,7 @@ impl<S: 'static> Modal<S> {
self
}
- fn render(mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Component<S> {
+ fn render(self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Component<S> {
let theme = theme(cx);
v_stack()
@@ -68,8 +68,8 @@ impl<S: 'static> Modal<S> {
.border_color(theme.border)
.p_1()
.justify_end()
- .children(self.secondary_action.take())
- .children(self.primary_action.take()),
+ .children(self.secondary_action)
+ .children(self.primary_action),
)
},
)
@@ -131,7 +131,7 @@ impl PaletteItem {
self
}
- fn render<S: 'static>(mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Component<S> {
+ fn render<S: 'static>(self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Component<S> {
div()
.flex()
.flex_row()
@@ -142,7 +142,7 @@ impl PaletteItem {
.child(Label::new(self.label.clone()))
.children(self.sublabel.clone().map(|sublabel| Label::new(sublabel))),
)
- .children(self.keybinding.take())
+ .children(self.keybinding)
}
}
@@ -26,7 +26,7 @@ impl<S: 'static> Details<S> {
self
}
- fn render(mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Component<S> {
+ fn render(self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Component<S> {
let theme = theme(cx);
v_stack()
@@ -37,7 +37,7 @@ impl<S: 'static> Details<S> {
.size_full()
.child(self.text)
.children(self.meta.map(|m| m))
- .children(self.actions.take().map(|a| a))
+ .children(self.actions.map(|a| a))
}
}