[PR #1432] [MERGED] Delete pub items nothing uses, and the stubs that hid unused code #3522

Closed
opened 2026-11-03 04:10:08 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1432
Author: @ludovic111
Created: 10/23/2026
Status: ✅ Merged
Merged: 10/23/2026
Merged by: @ludovic111

Base: main ← Head: chore/delete-unused-pub-items


📝 Commits (2)

  • 173a55e Delete pub items nothing uses, and the stubs that hid unused code
  • 5ca16b9 Keep version.rs as tools/gen_version_consts.py writes it

📊 Changes

80 files changed (+8 additions, -684 deletions)

View changed files

📝 crates/horizon-client/src/banner.rs (+1 -7)
📝 crates/horizon-client/src/block_entities.rs (+0 -3)
📝 crates/horizon-client/src/block_entity_anim.rs (+0 -12)
📝 crates/horizon-client/src/block_entity_render.rs (+0 -7)
📝 crates/horizon-client/src/clock.rs (+0 -4)
📝 crates/horizon-client/src/command/args.rs (+0 -8)
📝 crates/horizon-client/src/command/component.rs (+1 -5)
📝 crates/horizon-client/src/command/item.rs (+0 -4)
📝 crates/horizon-client/src/command/mod.rs (+0 -30)
📝 crates/horizon-client/src/command/snbt.rs (+1 -5)
📝 crates/horizon-client/src/command/vanilla.rs (+1 -7)
📝 crates/horizon-client/src/containers.rs (+0 -18)
📝 crates/horizon-client/src/debug_chart.rs (+0 -6)
📝 crates/horizon-client/src/enchant.rs (+0 -17)
📝 crates/horizon-client/src/first_person.rs (+0 -9)
📝 crates/horizon-client/src/game/chat.rs (+1 -5)
📝 crates/horizon-client/src/game/lan_trading.rs (+0 -17)
📝 crates/horizon-client/src/gfx.rs (+0 -4)
📝 crates/horizon-client/src/gfx/lod.rs (+0 -4)
📝 crates/horizon-client/src/gossip.rs (+0 -1)

...and 60 more files

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

From the review-0-survey (full code review plan: horizon-parity/reports/review-plan.md, workstream 5).

What

Deletes 93 pub items (78 functions and methods, 14 constants, 1 struct) in horizon-client, horizon-world, horizon-core, horizon-friends and horizon-server-files that nothing in the repository uses: not their crate, the other crates, the examples, the tests or the binaries. The imports and two private helpers only they used go too (title.rs date_string, goals.rs flag_index).

Also removes what #[allow(dead_code)]/#[allow(unused)] was hiding: chat_debug_fill, merchant_title and Goals::locked_by had no caller, and four stubs (_keep, _unused, _rule_kind, const _) existed only to keep an import used. LightTables::from_parts is used by its tests, so it is #[cfg(test)] instead of allowed.

Why

rustc can't report these: horizon-client, horizon-world and the others are libraries, where a pub item counts as used. Found by a name search over every .rs file in the repo (an item counted only if its name appears nowhere but its definition), then confirmed by the compiler.

Kept on purpose: the protocol packet ids and entity-data serializer ids (they mirror vanilla's registries in full), the mod SDK's on_chat (public API) and the launcher's three unused items (left for a launcher PR).

Deletions only, so the 696-line scope is over the usual 500; splitting it by crate would only multiply the parity runs.

How tested

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 62a6b3a62, 9 min 18 s)

Check Result
Scope ⚠️ 81 files, +8 −688; 696 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (4 s)
clippy ✅ (28 s)
tests: horizon-client, horizon-core, horizon-friends, horizon-server-files, horizon-world ✅ 1557 passed (5 min 53 s)
doc tests ✅ 0 passed (6 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (1 s)
launcher clippy ✅ (53 s)
launcher tests ✅ 111 passed (1 min 41 s)
Parity ➖ 324 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 312 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Parity: tools/parity.py --changed origin/main on an integration commit of this PR and the naga PR (all 329 harnesses depend on horizon-world): the probes built (3494 s on a busy Mac mini) and the first 7 harnesses passed (active_effect_tick, active_effects, anchor, attribute, attribute_health, attribute_updates, basic_feature), 0 failed. The agent stopped the local run there: at that machine's load the remaining 322 would have taken many hours and only duplicated this PR's own CI parity job on the same Mac mini. That job is the full --changed result. Rebased check: clippy -D warnings passes with both PRs merged onto main 6be7daeb.

Needs Ludovic

Nothing. Label: skip-release.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/1432 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/23/2026 **Status:** ✅ Merged **Merged:** 10/23/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `chore/delete-unused-pub-items` --- ### 📝 Commits (2) - [`173a55e`](https://github.com/horizon-rust/horizon/commit/173a55e60803eec759082107ab79bb71fbb2cff4) Delete pub items nothing uses, and the stubs that hid unused code - [`5ca16b9`](https://github.com/horizon-rust/horizon/commit/5ca16b97fcd4be7924064bd22cbc5fe4e86a6e4c) Keep version.rs as tools/gen_version_consts.py writes it ### 📊 Changes **80 files changed** (+8 additions, -684 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/banner.rs` (+1 -7) 📝 `crates/horizon-client/src/block_entities.rs` (+0 -3) 📝 `crates/horizon-client/src/block_entity_anim.rs` (+0 -12) 📝 `crates/horizon-client/src/block_entity_render.rs` (+0 -7) 📝 `crates/horizon-client/src/clock.rs` (+0 -4) 📝 `crates/horizon-client/src/command/args.rs` (+0 -8) 📝 `crates/horizon-client/src/command/component.rs` (+1 -5) 📝 `crates/horizon-client/src/command/item.rs` (+0 -4) 📝 `crates/horizon-client/src/command/mod.rs` (+0 -30) 📝 `crates/horizon-client/src/command/snbt.rs` (+1 -5) 📝 `crates/horizon-client/src/command/vanilla.rs` (+1 -7) 📝 `crates/horizon-client/src/containers.rs` (+0 -18) 📝 `crates/horizon-client/src/debug_chart.rs` (+0 -6) 📝 `crates/horizon-client/src/enchant.rs` (+0 -17) 📝 `crates/horizon-client/src/first_person.rs` (+0 -9) 📝 `crates/horizon-client/src/game/chat.rs` (+1 -5) 📝 `crates/horizon-client/src/game/lan_trading.rs` (+0 -17) 📝 `crates/horizon-client/src/gfx.rs` (+0 -4) 📝 `crates/horizon-client/src/gfx/lod.rs` (+0 -4) 📝 `crates/horizon-client/src/gossip.rs` (+0 -1) _...and 60 more files_ </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. From the review-0-survey (full code review plan: `horizon-parity/reports/review-plan.md`, workstream 5). ## What Deletes 93 `pub` items (78 functions and methods, 14 constants, 1 struct) in horizon-client, horizon-world, horizon-core, horizon-friends and horizon-server-files that nothing in the repository uses: not their crate, the other crates, the examples, the tests or the binaries. The imports and two private helpers only they used go too (`title.rs` `date_string`, `goals.rs` `flag_index`). Also removes what `#[allow(dead_code)]`/`#[allow(unused)]` was hiding: `chat_debug_fill`, `merchant_title` and `Goals::locked_by` had no caller, and four stubs (`_keep`, `_unused`, `_rule_kind`, `const _`) existed only to keep an import used. `LightTables::from_parts` is used by its tests, so it is `#[cfg(test)]` instead of allowed. ## Why rustc can't report these: horizon-client, horizon-world and the others are libraries, where a `pub` item counts as used. Found by a name search over every `.rs` file in the repo (an item counted only if its name appears nowhere but its definition), then confirmed by the compiler. Kept on purpose: the protocol packet ids and entity-data serializer ids (they mirror vanilla's registries in full), the mod SDK's `on_chat` (public API) and the launcher's three unused items (left for a launcher PR). Deletions only, so the 696-line scope is over the usual 500; splitting it by crate would only multiply the parity runs. ## How tested **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 62a6b3a62, 9 min 18 s) | Check | Result | | --- | --- | | Scope | ⚠️ 81 files, +8 −688; 696 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (4 s) | | clippy | ✅ (28 s) | | tests: horizon-client, horizon-core, horizon-friends, horizon-server-files, horizon-world | ✅ 1557 passed (5 min 53 s) | | doc tests | ✅ 0 passed (6 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (1 s) | | launcher clippy | ✅ (53 s) | | launcher tests | ✅ 111 passed (1 min 41 s) | | Parity | ➖ 324 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 312 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Parity: `tools/parity.py --changed origin/main` on an integration commit of this PR and the naga PR (all 329 harnesses depend on horizon-world): the probes built (3494 s on a busy Mac mini) and the first 7 harnesses passed (active_effect_tick, active_effects, anchor, attribute, attribute_health, attribute_updates, basic_feature), 0 failed. The agent stopped the local run there: at that machine's load the remaining 322 would have taken many hours and only duplicated this PR's own CI parity job on the same Mac mini. That job is the full `--changed` result. Rebased check: clippy -D warnings passes with both PRs merged onto main 6be7daeb. ## Needs Ludovic Nothing. Label: skip-release. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:10:08 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3522
No description provided.