perf: refactor to reduce memory allocations and cpu work

This commit is contained in:
Cheong Lau 2025-10-05 16:36:59 +10:00 committed by Michael Murphy
parent 0c3e3c8629
commit dd0158d8f0
24 changed files with 234 additions and 242 deletions

View file

@ -242,8 +242,8 @@ impl cosmic::Application for Window {
widget::column::with_capacity(4 + self.active_layouts.len()).padding([8, 0]);
for (id, layout) in self.active_layouts.iter().enumerate() {
let group = widget::column::with_capacity(2)
.push(widget::text::body(layout.description.clone()))
.push(widget::text::caption(layout.layout.clone()));
.push(widget::text::body(layout.description.as_str()))
.push(widget::text::caption(layout.layout.as_str()));
content_list = content_list
.push(applet::menu_button(group).on_press(Message::SetActiveLayout(id)));
}