lib.rs holds four unrelated types in over two thousand lines #31

Closed
opened 2026-08-16 00:35:18 +00:00 by rosa · 0 comments
Owner

What to build

lib.rs carries Money and its arithmetic, Currency, both ISO code types,
RoundingMode, five error enums, and the generated ISO catalog — a little over
two thousand lines. Every other concept in the crate already has a module of its
own. Give these the same treatment.

Split into money.rs, holding Money, MoneyError, and every arithmetic and
operator impl; and currency.rs, holding Currency, IsoAlphabeticCode,
IsoNumericCode, the generated catalog, and the four errors those types return.
lib.rs keeps the crate documentation, the module declarations, and the
re-exports. RoundingMode stays at the root.

Tests move with the code they cover. Nothing about the public API changes: every
path a caller writes today still resolves.

Acceptance criteria

  • Money and its operator impls live in money.rs
  • Currency, both code types, and the generated catalog live in currency.rs
  • Each module's tests sit beside the code they cover
  • lib.rs holds only crate documentation, module declarations, and re-exports
  • Every public path a caller uses today resolves unchanged
  • mise run ci passes

Blocked by

None — can start immediately.

## What to build `lib.rs` carries `Money` and its arithmetic, `Currency`, both ISO code types, `RoundingMode`, five error enums, and the generated ISO catalog — a little over two thousand lines. Every other concept in the crate already has a module of its own. Give these the same treatment. Split into `money.rs`, holding `Money`, `MoneyError`, and every arithmetic and operator impl; and `currency.rs`, holding `Currency`, `IsoAlphabeticCode`, `IsoNumericCode`, the generated catalog, and the four errors those types return. `lib.rs` keeps the crate documentation, the module declarations, and the re-exports. `RoundingMode` stays at the root. Tests move with the code they cover. Nothing about the public API changes: every path a caller writes today still resolves. ## Acceptance criteria - [ ] `Money` and its operator impls live in `money.rs` - [ ] `Currency`, both code types, and the generated catalog live in `currency.rs` - [ ] Each module's tests sit beside the code they cover - [ ] `lib.rs` holds only crate documentation, module declarations, and re-exports - [ ] Every public path a caller uses today resolves unchanged - [ ] `mise run ci` passes ## Blocked by None — can start immediately.
rosa closed this issue 2026-08-16 01:49:37 +00:00
Sign in to join this conversation.
No milestone
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
rosa/lucre#31
No description provided.