Skip to content

Conversation

@onkoe
Copy link

@onkoe onkoe commented Oct 22, 2025

This isn't tested since my Mac has low storage. But here's a little peek into how no-alloc support could be done.

Thanks for the great crate! :)

Context

I want to use the rust_decimal crate in my own library, but the lack of core-only support is a blocker to something I want to do.

Checklist

  • Add test crate with the following setup:
    • Depend on rust_decimal in Cargo.toml
    • Have a veeery basic lib.rs and pub fn t() -> Decimal { /* ... */ }
    • Build with: cargo +nightly build --no-default-features -Z build-std=core --target x86_64-unknown-none
      • Need to pin the Nightly
  • Document no_std + core-only compatibility in README.md
  • Make block comments in error.rs look consistent (and maybe even readable)
  • Fix "system dependency required" tests expecting stringy errors

Unrelated

A couple more suggestions before 2.0:

  • Move all the integrations into src/integrations/(...).rs files
    • You can re-export them in lib.rs if you'd like to maintain the same API surface
      • mod integrations; pub use integrations::*;
    • But, as-is, it's difficult to focus on the primary logic files in the crate
  • Rename Error to DecimalError

@Tony-Samuels
Copy link
Collaborator

This looks like a sensible change for v2. Are you planning to continue with it from here, if I enable the CI for validation, or are you looking to hand this over to someone else?

@onkoe
Copy link
Author

onkoe commented Oct 22, 2025

Thanks for the quick notice! I can continue. But: my availability is currently rather limited.

If you'd like to release 2.0 (or RCs) in the next week or so, you can freely give this to someone else! Just want to see it pushed through :D

@Tony-Samuels
Copy link
Collaborator

Our current v2 timeframe is quite long, I think. There's still a few larger redesigns we want to consider that we haven't spent much time on, mostly around how to support all the feature requests for support for various serialization (and other) crates.

onkoe added 4 commits October 24, 2025 23:11
feat: add `alloc` feature by default
this permits `no-std::no-alloc` support

feat: replace string errs with variants

this permits `no-std::no-alloc` support
@onkoe onkoe force-pushed the feat/no_std_no_alloc branch from 31d7b67 to 64495b9 Compare October 25, 2025 04:12
@onkoe
Copy link
Author

onkoe commented Oct 25, 2025

This passes locally with: systemctl start podman --user && act -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-22.04 -j postgres_tests --matrix rust:stable

I'd like to see if the "real" CI runs before I make any other changes, though. (ran outta storage on my PC when running all the different jobs lol)

(note for future Fedora/RHEL users: the required packages for building this crate w/ MySQL are not present in the system package manager. you can use Pixi, or just rely on CI to guide you)

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