Skip to content

feat: scaffold Rust crate (edition 2024, serde + jiff)#43

Merged
ropdias merged 1 commit into
inbrace-tech:rust-parity-v1from
FabioRocha231:slice-00-scaffold
Jul 5, 2026
Merged

feat: scaffold Rust crate (edition 2024, serde + jiff)#43
ropdias merged 1 commit into
inbrace-tech:rust-parity-v1from
FabioRocha231:slice-00-scaffold

Conversation

@FabioRocha231

Copy link
Copy Markdown
Contributor

Slice 0 / 11 of the bottom-up Rust rewrite tracked in #27 — the crate scaffold.

Each later slice lands one module + its tests against a green build, in dependency order, so CI stays green and any regression is trivial to bisect. This PR is just the skeleton.

  • rust/ single binary crate tokenline, flat src/, edition 2024, MSRV 1.85.
  • Deps: serde + serde_json + jiff (jiff::Timestamp for ISO-8601 → epoch, first used in slice 3).
  • panic = "unwind" in the release profile — the final slice's top-level catch_unwind (never-crash) depends on it.
  • main.rs is a stub, lib.rs is the module root. cargo build / run / test green (0 tests).

Stacked series — this is the base; subsequent slice PRs target their predecessor and retarget to main as each merges.

Slice 0 of the bottom-up Rust rewrite (inbrace-tech#27): the crate skeleton so every later
slice lands its module + test against a green build.

- rust/ single binary crate 'tokenline', flat src/, edition 2024, MSRV 1.85.
- deps: serde + serde_json + jiff (jiff::Timestamp for ISO-8601, lands slice 3).
- panic = "unwind" in the release profile (the final slice's catch_unwind needs it).
- main.rs is a stub; lib.rs is the module root. cargo build/run/test green (0 tests).

@ropdias ropdias left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and tested locally on WSL2 (rustc 1.96.1). All gates green:

  • cargo build --locked
  • cargo test --locked ✅ (0 tests, as expected)
  • cargo clippy --locked --all-targets -- -D warnings ✅ (no warnings)
  • cargo fmt --check ✅ (no diffs)
  • cargo build --release --locked ✅ → 287 KB stripped binary, runs and exits 0

Clean, well-scoped scaffold. A few things I really liked:

  • The bin + lib split from day one — pure, golden-testable domain in lib.rs
    and a thin stateful edge in main.rs. Exactly the shape the rewrite needs.
  • panic = "unwind" kept explicitly in the release profile, against the usual
    "add panic=abort to shrink the binary" advice, because the never-crash design
    depends on catch_unwind. The inline comment makes the intent unmistakable.
  • edition = "2024" and rust-version = "1.85" are internally consistent, and
    Cargo.lock is committed (correct for a binary).

Solid base for the stack. Approving. 🚀

@ropdias ropdias merged commit 872aae5 into inbrace-tech:rust-parity-v1 Jul 5, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants