Skip to content

Refactor RMB converter into reusable Rust library#3

Merged
bigtomcat6 merged 44 commits into
mainfrom
refactor/rust-library
May 30, 2026
Merged

Refactor RMB converter into reusable Rust library#3
bigtomcat6 merged 44 commits into
mainfrom
refactor/rust-library

Conversation

@bigtomcat6

Copy link
Copy Markdown
Owner

Summary

  • Refactor the project into a reusable pure Rust library with optional N-API bindings.
  • Add deterministic money APIs based on integer cents and string parsing.
  • Add RmbError for invalid, negative, too-large, and non-finite inputs.
  • Preserve the existing rmbToRmb(number) Node.js API for compatibility and add string-based N-API entry points.
  • Update README and add GitHub Actions CI for formatting, clippy, Rust tests, and N-API feature checks.

Validation

  • Added Rust unit tests covering zero, integer amounts, cents, group boundaries, maximum value, decimal parsing, cents-string parsing, and invalid inputs.
  • CI is configured to run cargo fmt --all -- --check, cargo clippy --all-targets -- -D warnings, cargo test, and cargo test --features napi.

Note: local test execution was not available in the current environment, so the PR CI is the source of truth for final validation.

bigtomcat6 added 30 commits May 30, 2026 11:41
@bigtomcat6 bigtomcat6 merged commit 00e106c into main May 30, 2026
1 check 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.

1 participant