diff --git a/.buildnumber b/.buildnumber index 75cc69b..0357f4f 100644 --- a/.buildnumber +++ b/.buildnumber @@ -1,3 +1,3 @@ 1 34 -1 +2 diff --git a/Cargo.toml b/Cargo.toml index 78651c0..2292fa3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ name = "rust_decimal" readme = "./README.md" repository = "https://github.com/paupino/rust-decimal" rust-version = "1.60" -version = "1.34.1" +version = "1.34.2" [package.metadata.docs.rs] all-features = true @@ -32,7 +32,7 @@ proptest = { default-features = false, optional = true, features = ["std"], vers rand = { default-features = false, optional = true, version = "0.8" } rkyv = { default-features = false, features = ["size_32", "std"], optional = true, version = "0.7.42" } rocket = { default-features = false, optional = true, version = "0.5.0-rc.3" } -rust_decimal_macros = { default-features = false, optional = true, version = "1.34" } # This needs to a published version +#rust_decimal_macros = { default-features = false, optional = true, version = "1.34" } # This needs to a published version serde = { default-features = false, optional = true, version = "1.0" } serde_json = { default-features = false, optional = true, version = "1.0" } tokio-postgres = { default-features = false, optional = true, version = "0.7" } @@ -52,7 +52,8 @@ version-sync = { default-features = false, features = ["html_root_url_updated", [features] default = ["serde", "std"] -macros = ["dep:rust_decimal_macros"] +# Removed in 1.34.2 due to an issue during version resolution +#macros = ["dep:rust_decimal_macros"] borsh = ["dep:borsh", "std"] c-repr = [] # Force Decimal to be repr(C) diff --git a/README.md b/README.md index 7b4dea8..1927044 100644 --- a/README.md +++ b/README.md @@ -17,17 +17,18 @@ The binary representation consists of a 96 bit integer number, a scaling factor $ cargo add rust_decimal ``` -If you would like to use the optimized macro for convenient creation of decimals you can add `rust_decimal` with the `macros` feature flag: +In addition, if you would like to use the optimized macro for convenient creation of decimals: ```sh -$ cargo add rust_decimal --features macros +$ cargo add rust_decimal_macros ``` Alternatively, you can edit your `Cargo.toml` directly and run `cargo update`: ```toml [dependencies] -rust_decimal = { version = "1.34", features = ["macros"] } +rust_decimal = "1.34" +rust_decimal_macros = "1.34" ``` ## Usage @@ -35,9 +36,7 @@ rust_decimal = { version = "1.34", features = ["macros"] } Decimal numbers can be created in a few distinct ways. The easiest and most efficient method of creating a Decimal is to use the procedural macro that can be enabled using the `macros` feature: ```rust -// The macros feature exposes a `dec` macro which will parse the input into a raw decimal number at compile time. -// It is also exposed when using `rust_decimal::prelude::*`. That said, you can also import the -// `rust_decimal_macros` crate and use the macro directly from there. +// Import the `rust_decimal_macros` crate and use the macro directly from there. use rust_decimal_macros::dec; let number = dec!(-1.23) + dec!(3.45); diff --git a/examples/serde-json-scenarios/Cargo.toml b/examples/serde-json-scenarios/Cargo.toml index 5d39048..f6be4fc 100644 --- a/examples/serde-json-scenarios/Cargo.toml +++ b/examples/serde-json-scenarios/Cargo.toml @@ -7,6 +7,7 @@ publish = false [workspace] [dependencies] -rust_decimal = { path = "../..", features = ["macros", "serde-with-arbitrary-precision"] } +rust_decimal = { path = "../..", features = ["serde-with-arbitrary-precision"] } +rust_decimal_macros = { path = "../../macros" } serde = { version = "1.0", features = ["derive"] } serde_json = { version = "1.0", features = ["arbitrary_precision"]} diff --git a/examples/serde-json-scenarios/src/main.rs b/examples/serde-json-scenarios/src/main.rs index 168950a..a173e77 100644 --- a/examples/serde-json-scenarios/src/main.rs +++ b/examples/serde-json-scenarios/src/main.rs @@ -1,4 +1,5 @@ use rust_decimal::prelude::*; +use rust_decimal_macros::dec; type ExampleResult = Result<(), Box>; diff --git a/src/lib.rs b/src/lib.rs index cb3c7dc..d49db64 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -58,8 +58,8 @@ pub use error::Error; #[cfg(feature = "maths")] pub use maths::MathematicalOps; -#[cfg(feature = "macros")] -pub use rust_decimal_macros::dec; +// #[cfg(feature = "macros")] +// pub use rust_decimal_macros::dec; /// A convenience module appropriate for glob imports (`use rust_decimal::prelude::*;`). pub mod prelude { @@ -68,8 +68,8 @@ pub mod prelude { pub use crate::{Decimal, RoundingStrategy}; pub use core::str::FromStr; pub use num_traits::{FromPrimitive, One, Signed, ToPrimitive, Zero}; - #[cfg(feature = "macros")] - pub use rust_decimal_macros::dec; + // #[cfg(feature = "macros")] + // pub use rust_decimal_macros::dec; } #[cfg(all(feature = "diesel1", not(feature = "diesel2")))]