lib

Core libraries for Radroots
git clone https://radroots.dev/git/lib.git
Log | Files | Refs | README | LICENSE

commit 8c3c1496ff6db8b4fa10b261fa04539341469df8
parent d8f722ca51aed19e0a4d6dbbe0520661af98359f
Author: triesap <tyson@radroots.org>
Date:   Sun, 22 Feb 2026 02:42:02 +0000

xtask: format contract validation helpers


- run rustfmt for the xtask crate manifest scope
- normalize enum parsing and path read wrapping in contract checks
- keep xtask contract validation behavior unchanged with formatting-only edits
- preserve xtask tests and sdk command paths after formatting

Diffstat:
Mcrates/xtask/src/contract.rs | 15+++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/crates/xtask/src/contract.rs b/crates/xtask/src/contract.rs @@ -137,7 +137,10 @@ fn parse_enum_variants(enum_body: &str) -> Vec<String> { if trimmed.is_empty() || trimmed.starts_with('#') || trimmed.starts_with("//") { return None; } - let before_comma = trimmed.split_once(',').map_or(trimmed, |(head, _)| head).trim(); + let before_comma = trimmed + .split_once(',') + .map_or(trimmed, |(head, _)| head) + .trim(); if before_comma.is_empty() { return None; } @@ -161,9 +164,13 @@ fn parse_enum_variants(enum_body: &str) -> Vec<String> { } fn validate_core_unit_dimension_variant_order(workspace_root: &Path) -> Result<(), String> { - let source_path = workspace_root.join("crates").join("core").join("src").join("unit.rs"); - let source = - fs::read_to_string(&source_path).map_err(|e| format!("read {}: {e}", source_path.display()))?; + let source_path = workspace_root + .join("crates") + .join("core") + .join("src") + .join("unit.rs"); + let source = fs::read_to_string(&source_path) + .map_err(|e| format!("read {}: {e}", source_path.display()))?; let enum_body = extract_enum_body(&source, CORE_UNIT_DIMENSION_ENUM)?; let variants = parse_enum_variants(enum_body); let expected = CORE_UNIT_DIMENSION_ORDER