Skip to content

Commit 179039a

Browse files
authored
Rollback macros feature flag due to dependency resolution issues (#643)
1 parent 999bb02 commit 179039a

File tree

6 files changed

+17
-15
lines changed

6 files changed

+17
-15
lines changed

.buildnumber

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
1
22
34
3-
1
3+
2

Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ name = "rust_decimal"
1212
readme = "./README.md"
1313
repository = "https://github.com/paupino/rust-decimal"
1414
rust-version = "1.60"
15-
version = "1.34.1"
15+
version = "1.34.2"
1616

1717
[package.metadata.docs.rs]
1818
all-features = true
@@ -32,7 +32,7 @@ proptest = { default-features = false, optional = true, features = ["std"], vers
3232
rand = { default-features = false, optional = true, version = "0.8" }
3333
rkyv = { default-features = false, features = ["size_32", "std"], optional = true, version = "0.7.42" }
3434
rocket = { default-features = false, optional = true, version = "0.5.0-rc.3" }
35-
rust_decimal_macros = { default-features = false, optional = true, version = "1.34" } # This needs to a published version
35+
#rust_decimal_macros = { default-features = false, optional = true, version = "1.34" } # This needs to a published version
3636
serde = { default-features = false, optional = true, version = "1.0" }
3737
serde_json = { default-features = false, optional = true, version = "1.0" }
3838
tokio-postgres = { default-features = false, optional = true, version = "0.7" }
@@ -52,7 +52,8 @@ version-sync = { default-features = false, features = ["html_root_url_updated",
5252

5353
[features]
5454
default = ["serde", "std"]
55-
macros = ["dep:rust_decimal_macros"]
55+
# Removed in 1.34.2 due to an issue during version resolution
56+
#macros = ["dep:rust_decimal_macros"]
5657

5758
borsh = ["dep:borsh", "std"]
5859
c-repr = [] # Force Decimal to be repr(C)

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,26 @@ The binary representation consists of a 96 bit integer number, a scaling factor
1717
$ cargo add rust_decimal
1818
```
1919

20-
If you would like to use the optimized macro for convenient creation of decimals you can add `rust_decimal` with the `macros` feature flag:
20+
In addition, if you would like to use the optimized macro for convenient creation of decimals:
2121

2222
```sh
23-
$ cargo add rust_decimal --features macros
23+
$ cargo add rust_decimal_macros
2424
```
2525

2626
Alternatively, you can edit your `Cargo.toml` directly and run `cargo update`:
2727

2828
```toml
2929
[dependencies]
30-
rust_decimal = { version = "1.34", features = ["macros"] }
30+
rust_decimal = "1.34"
31+
rust_decimal_macros = "1.34"
3132
```
3233

3334
## Usage
3435

3536
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:
3637

3738
```rust
38-
// The macros feature exposes a `dec` macro which will parse the input into a raw decimal number at compile time.
39-
// It is also exposed when using `rust_decimal::prelude::*`. That said, you can also import the
40-
// `rust_decimal_macros` crate and use the macro directly from there.
39+
// Import the `rust_decimal_macros` crate and use the macro directly from there.
4140
use rust_decimal_macros::dec;
4241

4342
let number = dec!(-1.23) + dec!(3.45);

examples/serde-json-scenarios/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ publish = false
77
[workspace]
88

99
[dependencies]
10-
rust_decimal = { path = "../..", features = ["macros", "serde-with-arbitrary-precision"] }
10+
rust_decimal = { path = "../..", features = ["serde-with-arbitrary-precision"] }
11+
rust_decimal_macros = { path = "../../macros" }
1112
serde = { version = "1.0", features = ["derive"] }
1213
serde_json = { version = "1.0", features = ["arbitrary_precision"]}

examples/serde-json-scenarios/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use rust_decimal::prelude::*;
2+
use rust_decimal_macros::dec;
23

34
type ExampleResult = Result<(), Box<dyn std::error::Error>>;
45

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ pub use error::Error;
5858
#[cfg(feature = "maths")]
5959
pub use maths::MathematicalOps;
6060

61-
#[cfg(feature = "macros")]
62-
pub use rust_decimal_macros::dec;
61+
// #[cfg(feature = "macros")]
62+
// pub use rust_decimal_macros::dec;
6363

6464
/// A convenience module appropriate for glob imports (`use rust_decimal::prelude::*;`).
6565
pub mod prelude {
@@ -68,8 +68,8 @@ pub mod prelude {
6868
pub use crate::{Decimal, RoundingStrategy};
6969
pub use core::str::FromStr;
7070
pub use num_traits::{FromPrimitive, One, Signed, ToPrimitive, Zero};
71-
#[cfg(feature = "macros")]
72-
pub use rust_decimal_macros::dec;
71+
// #[cfg(feature = "macros")]
72+
// pub use rust_decimal_macros::dec;
7373
}
7474

7575
#[cfg(all(feature = "diesel1", not(feature = "diesel2")))]

0 commit comments

Comments
 (0)