From b43eb66a5dc6af34a0d2f0897797dfac095181d4 Mon Sep 17 00:00:00 2001 From: SinuS Von SifriduS Date: Wed, 16 Sep 2026 11:40:22 +0200 Subject: [PATCH] 0.1.0-0-pre.11-fix.1 --- Cargo.toml | 4 +- crates/games/game-snake-poc/src/lib.rs | 4 +- crates/games/game-snake-poc/src/state.rs | 4 +- deltas/0.1.0/0-pre.11.fix.1.md | 75 ++++++++++++++++++++++++ 4 files changed, 82 insertions(+), 5 deletions(-) create mode 100644 deltas/0.1.0/0-pre.11.fix.1.md diff --git a/Cargo.toml b/Cargo.toml index f75df55..3dc5493 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ # file: Cargo.toml -# version: 21 +# version: 22 [workspace] resolver = "3" @@ -17,7 +17,7 @@ members = [ ] [workspace.package] -version = "0.1.0-0-pre.11" +version = "0.1.0-0-pre.11.fix.1" edition = "2024" license = "MIT" repository = "https://git.sasedev.com/Sasedev/games" diff --git a/crates/games/game-snake-poc/src/lib.rs b/crates/games/game-snake-poc/src/lib.rs index a6f8cb0..b12b96f 100644 --- a/crates/games/game-snake-poc/src/lib.rs +++ b/crates/games/game-snake-poc/src/lib.rs @@ -1,5 +1,5 @@ // file: crates/games/game-snake-poc/src/lib.rs -// version: 1 +// version: 2 #![warn(missing_docs)] #![deny(unreachable_pub)] @@ -9,5 +9,7 @@ mod state; +/// Re-export of one Snake grid cell. +pub use self::state::SnakeCell; /// Re-export of the Snake POC state. pub use self::state::SnakeState; diff --git a/crates/games/game-snake-poc/src/state.rs b/crates/games/game-snake-poc/src/state.rs index 54a29f7..0485386 100644 --- a/crates/games/game-snake-poc/src/state.rs +++ b/crates/games/game-snake-poc/src/state.rs @@ -1,5 +1,5 @@ // file: crates/games/game-snake-poc/src/state.rs -// version: 4 +// version: 5 const GRID_HEIGHT: i16 = 20; const GRID_WIDTH: i16 = 12; @@ -169,7 +169,7 @@ impl SnakeState { impl engine_v1_common::EngineGame for SnakeState { fn update(&mut self, frame: engine_v1_common::EngineFrame, input: engine_v1_common::InputState) { self.apply_direction_input(input); - if frame.index() % MOVE_EVERY_FRAMES == 0 { + if frame.index().is_multiple_of(MOVE_EVERY_FRAMES) { self.move_once(); } return; diff --git a/deltas/0.1.0/0-pre.11.fix.1.md b/deltas/0.1.0/0-pre.11.fix.1.md new file mode 100644 index 0000000..1ed200b --- /dev/null +++ b/deltas/0.1.0/0-pre.11.fix.1.md @@ -0,0 +1,75 @@ + + + +# Delta 0.1.0-0-pre.11.fix.1 + +## Base + +Base déclarée : `0.1.0-0-pre.11`, non validée. + +## Échecs observés + +La validation de `0-pre.11` a révélé deux défauts locaux. + +### Clippy + +Rust/Clippy 1.94 signale : + +```text +manual implementation of `.is_multiple_of()` +``` + +Le code : + +```text +frame.index() % MOVE_EVERY_FRAMES == 0 +``` + +est remplacé par : + +```text +frame.index().is_multiple_of(MOVE_EVERY_FRAMES) +``` + +### Façade du crate Snake + +`SnakeCell` est public dans `state.rs`, mais n'était pas réexporté par `lib.rs`. + +Les tests accèdent légitimement à `crate::SnakeCell`; le type doit donc être exposé par la façade du crate conformément aux règles du workspace. + +`lib.rs` réexporte désormais : + +```text +SnakeCell +SnakeState +``` + +## Validation à exécuter + +```bash +cargo fmt --all +cargo fmt --all -- --check + +python3 scripts/audit_rust_workspace_rules.py +python3 scripts/audit_markdown_tables.py README.md RULES.md ROADMAP.md CHANGELOG.md docs prompts crates Android deltas history + +cargo check --workspace +cargo clippy --workspace --all-targets --all-features -- -D warnings + +cargo test -p engine-v1-sdl --all-targets --all-features +cargo test -p game-snake-poc --all-targets --all-features +``` + +Puis : + +```bash +cargo run -p game-snake-poc-desktop +``` + +Si le smoke Desktop est propre, poursuivre les validations Android prévues par `0-pre.11`. + +## Transition + +Si toutes les gates `0-pre.11` sont propres, `0.1.0-0-pre.11.fix.1` valide la fin de la phase `0-pre.*`. + +En cas d'échec imputable au projet, produire `0.1.0-0-pre.11.fix.2`.