[PR #1695] [MERGED] Cleanup: one predicate property helper, a Windows-only allow, tolerant locks in the bots #3697

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

📋 Pull Request Information

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

Base: main ← Head: chore/deslop


📝 Commits (2)

  • c10261f Cleanup: one predicate property helper, a Windows-only allow, tolerant locks in the bots
  • b470bec Cleanup: one lock helper in horizon-bots, the predicate helper beside its trait

📊 Changes

5 files changed (+47 additions, -47 deletions)

View changed files

📝 crates/horizon-bots/src/main.rs (+25 -25)
📝 crates/horizon-world/src/worldgen/block_feature.rs (+1 -11)
📝 crates/horizon-world/src/worldgen/block_predicate.rs (+16 -0)
📝 crates/horizon-world/src/worldgen/state_provider.rs (+1 -11)
📝 launcher/src/mojang.rs (+4 -0)

📄 Description

🤖 Agent

Three cleanups from a pass over the tree, none of which change behaviour.

launcher/src/mojang.rs: name_in and link_stays_inside are used by the unix link step, so on Windows they are dead and cargo clippy --all-targets -- -D warnings in launcher/ failed on them, on main as well as on every branch. Deleting them is wrong, since the path-traversal check is worth testing on Windows too, so they carry #[cfg_attr(not(unix), allow(dead_code))]. That red is gone: cargo clippy --all-targets -- -D warnings in launcher/ now reports no errors.

worldgen: predicate_property was the same fifteen lines twice, in block_feature.rs and state_provider.rs, both reading the same Option<[BoundBlockProperty; 4]>. It is one worldgen::bound_property(values, property) now, with the two methods calling it. Same order, same error, thirty fewer lines.

horizon-bots: twenty .lock().unwrap() in the test harness become unwrap_or_else(|e| e.into_inner()), so one panicking bot thread no longer brings the whole run down with a poisoned lock.

Found and left alone, with reasons: device() is duplicated between gfx/animate.rs and gfx/upload.rs but it is a test-only wgpu setup helper, and folding it needs a shared #[cfg(test)] module for twelve lines; sense_players, sense_hurt, can_use and guest are near-copies inside the mob brains and the LAN menu, where the surrounding types differ and a mechanical merge would need the parity harnesses to prove nothing moved. No comment in the tree is written in a second language (the one Cyrillic line in clipboard.rs explains a Russian key in a test).

cargo check -p horizon-world -p horizon-client -p horizon-bots is clean, and a debug build of the client runs.


🔄 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/1695 **Author:** [@Domanffe](https://github.com/Domanffe) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `chore/deslop` --- ### 📝 Commits (2) - [`c10261f`](https://github.com/horizon-rust/horizon/commit/c10261f008e4a80344bfb8c3f14232c6ffffe632) Cleanup: one predicate property helper, a Windows-only allow, tolerant locks in the bots - [`b470bec`](https://github.com/horizon-rust/horizon/commit/b470bec351a8c572e26e9efcc17229093cd95b7f) Cleanup: one lock helper in horizon-bots, the predicate helper beside its trait ### 📊 Changes **5 files changed** (+47 additions, -47 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-bots/src/main.rs` (+25 -25) 📝 `crates/horizon-world/src/worldgen/block_feature.rs` (+1 -11) 📝 `crates/horizon-world/src/worldgen/block_predicate.rs` (+16 -0) 📝 `crates/horizon-world/src/worldgen/state_provider.rs` (+1 -11) 📝 `launcher/src/mojang.rs` (+4 -0) </details> ### 📄 Description 🤖 Agent Three cleanups from a pass over the tree, none of which change behaviour. `launcher/src/mojang.rs`: `name_in` and `link_stays_inside` are used by the unix link step, so on Windows they are dead and `cargo clippy --all-targets -- -D warnings` in `launcher/` failed on them, on main as well as on every branch. Deleting them is wrong, since the path-traversal check is worth testing on Windows too, so they carry `#[cfg_attr(not(unix), allow(dead_code))]`. That red is gone: `cargo clippy --all-targets -- -D warnings` in `launcher/` now reports no errors. `worldgen`: `predicate_property` was the same fifteen lines twice, in `block_feature.rs` and `state_provider.rs`, both reading the same `Option<[BoundBlockProperty; 4]>`. It is one `worldgen::bound_property(values, property)` now, with the two methods calling it. Same order, same error, thirty fewer lines. `horizon-bots`: twenty `.lock().unwrap()` in the test harness become `unwrap_or_else(|e| e.into_inner())`, so one panicking bot thread no longer brings the whole run down with a poisoned lock. Found and left alone, with reasons: `device()` is duplicated between `gfx/animate.rs` and `gfx/upload.rs` but it is a test-only wgpu setup helper, and folding it needs a shared `#[cfg(test)]` module for twelve lines; `sense_players`, `sense_hurt`, `can_use` and `guest` are near-copies inside the mob brains and the LAN menu, where the surrounding types differ and a mechanical merge would need the parity harnesses to prove nothing moved. No comment in the tree is written in a second language (the one Cyrillic line in `clipboard.rs` explains a Russian key in a test). `cargo check -p horizon-world -p horizon-client -p horizon-bots` is clean, and a debug build of the client runs. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:11:30 +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#3697
No description provided.