Reduce allocations (#30693)

Removes a unnecessary string conversion and some clones

Release Notes:

- N/A
This commit is contained in:
tidely
2025-05-14 18:29:28 +02:00
committed by GitHub
parent fcfe4e2c14
commit bc99a86bb7
17 changed files with 48 additions and 57 deletions
@@ -77,7 +77,7 @@ impl QuickActionBar {
let menu_state = session_state(session.clone(), cx);
let id = "repl-menu".to_string();
let id = "repl-menu";
let element_id = |suffix| ElementId::Name(format!("{}-{}", id, suffix).into());
@@ -99,8 +99,7 @@ impl QuickActionBar {
.child(
Label::new(format!(
"kernel: {} ({})",
menu_state.kernel_name.clone(),
menu_state.kernel_language.clone()
menu_state.kernel_name, menu_state.kernel_language
))
.size(LabelSize::Small)
.color(Color::Muted),
@@ -121,7 +120,7 @@ impl QuickActionBar {
menu.custom_row(move |_window, _cx| {
h_flex()
.child(
Label::new(format!("{}...", status.clone().to_string()))
Label::new(format!("{}...", status.to_string()))
.size(LabelSize::Small)
.color(Color::Muted),
)