v0.6.0-alpha.5
Pre-release
Pre-release
·
2 commits
to main
since this release
Major redesign of Rect internal storage and API cleanup, laying groundwork for v1.0.
Added
Rect::new(x, y, width, height)— primary constructor matching game framework conventionRect::from_tl_size(Pos, Size)— renamed fromRect::new(Pos, Size)Rect::width_usize()/Rect::height_usize()— for indexing usePos::cmp_row_major()— y-primary comparison for grid iterationimpl Display for Size— formats as10×20- Type aliases:
Pos16,PosIfor positions,Rect16,RectIfor rectangles - Optional
serdefeature (serde = ["dep:serde"]) cargo-semver-checksin CIBlocklayout, which stores data in continuous fixed-size (W x H) blocksAGENTS.md— guidelines for LLM contributors
Changed
Rectinternal storage changed from(l, t, r, b)to(x, y, w, h)— all fields areTRect::width()andRect::height()now returnT(wasusize)Rect::from_ltrb_unchecked()is no longerunsafe— usesdebug_assert!- Removed
T: Intbound fromPosandRectstruct definitions (C-STRUCT-BOUNDS) Rect::new(Pos, Size)renamed toRect::from_tl_size(Pos, Size)Layouthas been split into 2 traits:Layoutfor iterating over positions, rectangles, and elementsLinearfor an (optional) optimization of linear-aligned data
- Layouts are now
&selfinstead of static-only, allowing for dynamic dispatch - License changed to
MIT OR Apache-2.0(wasMIT) - Lint configuration aligned with rg: added
rust.nursery,must_use_candidate, more
Removed
unsafecode from production codebase (forbid(unsafe_code))AsRef/AsMutimpls onPos(depended onunsafepointer casts)Rect::iter_posand related methods; use the layout traits instead.gemini/GEMINI.md— replaced byAGENTS.md