Support `no-std::no-alloc`
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_decimalin Cargo.toml - Have a veeery basic
lib.rsandpub 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
- Depend on
- [ ] Document
no_std+core-only compatibility inREADME.md - [ ] Make block comments in
error.rslook consistent (and maybe even readable) - [x] Fix "system dependency required" tests expecting stringy errors
Unrelated
A couple more suggestions before 2.0:
- Move all the integrations into
src/integrations/(...).rsfiles- You can re-export them in
lib.rsif 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
- You can re-export them in
- Rename
ErrortoDecimalError- Per Clippy: https://rust-lang.github.io/rust-clippy/master/index.html#error_impl_error
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?
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
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.
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)