From 4ff7118db731926f450f427aab86e28a29f9c567 Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 28 Oct 2026 10:55:47 +0300 Subject: [PATCH 1/2] Creative screen: draw the selected tab from a reference tab_headers() builds a header per tab without the item lists, and the caller then cloned the selected one again: three Strings copied every frame the screen is open. Borrow it instead. Co-Authored-By: Hermes Agent (Nous Research) --- crates/horizon-client/src/game.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/horizon-client/src/game.rs b/crates/horizon-client/src/game.rs index 1d7bbbbd6..beef47123 100644 --- a/crates/horizon-client/src/game.rs +++ b/crates/horizon-client/src/game.rs @@ -11066,7 +11066,7 @@ impl Game<'_> { let selected = self.creative_screen.selected; // Only what is drawn of the tabs: their stacks stay where they are. let tabs = self.creative_screen.tab_headers(); - let tab = tabs[selected.min(tabs.len() - 1)].clone(); + let tab = &tabs[selected.min(tabs.len() - 1)]; let tab_sprite = |t: &horizon_client::creative::Tab, on: bool| { format!( "gui/sprites/container/creative_inventory/tab_{}_{}_{}", @@ -11121,7 +11121,7 @@ impl Game<'_> { } let atlas = &self.gui.atlas; if !tab.inventory { - let title = self.creative_tab_title(&tab); + let title = self.creative_tab_title(tab); batch.text( atlas, &title, From d1ead6a5fa43c4fe645a2d811e7013edda620047 Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 28 Oct 2026 11:09:17 +0300 Subject: [PATCH 2/2] Clippy: tab is already a reference Co-Authored-By: Hermes Agent (Nous Research) --- crates/horizon-client/src/game.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/horizon-client/src/game.rs b/crates/horizon-client/src/game.rs index beef47123..918ef4f65 100644 --- a/crates/horizon-client/src/game.rs +++ b/crates/horizon-client/src/game.rs @@ -11102,8 +11102,8 @@ impl Game<'_> { r.v1 = r.v0 + (r.v1 - r.v0) * Creative::HEIGHT / r.h as f32; batch.rect_uv(ox, oy, Creative::WIDTH, Creative::HEIGHT, r, u32::MAX); } - let (tx, ty) = Creative::tab_position(&tab); - batch.sprite(&self.gui.atlas, &tab_sprite(&tab, true), ox + tx, oy + ty); + let (tx, ty) = Creative::tab_position(tab); + batch.sprite(&self.gui.atlas, &tab_sprite(tab, true), ox + tx, oy + ty); for t in &tabs { let (tx, ty) = Creative::tab_position(t); let stack = ItemStack {