Skip to content

Commit

Permalink
Version 1.20 (#462)
Browse files Browse the repository at this point in the history
  • Loading branch information
paupino authored Jan 11, 2022
1 parent 30eb444 commit 6d4c894
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ license = "MIT"
name = "rust_decimal"
readme = "./README.md"
repository = "https://github.com/paupino/rust-decimal"
version = "1.19.0"
version = "1.20.0"

[package.metadata.docs.rs]
all-features = true
Expand Down
34 changes: 27 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ To get started, add `rust_decimal` and optionally `rust_decimal_macros` to your

```toml
[dependencies]
rust_decimal = "1.19"
rust_decimal_macros = "1.19"
rust_decimal = "1.20"
rust_decimal_macros = "1.20"
```

## Usage
Expand Down Expand Up @@ -73,19 +73,30 @@ assert_eq!(total.to_string(), "27.26");

## Features

**Behavior / Functionality**

* [c-repr](#c-repr)
* [db-postgres](#db-postgres)
* [db-tokio-postgres](#db-tokio-postgres)
* [db-diesel-postgres](#db-diesel-postgres)
* [db-diesel-mysql](#db-diesel-mysql)
* [legacy-ops](#legacy-ops)
* [maths](#maths)
* [rocket-traits](#rocket-traits)
* [rust-fuzz](#rust-fuzz)
* [std](#std)

**Database**

* [db-postgres](#db-postgres)
* [db-tokio-postgres](#db-tokio-postgres)
* [db-diesel-postgres](#db-diesel-postgres)
* [db-diesel-mysql](#db-diesel-mysql)

**Serde**

* [serde-float](#serde-float)
* [serde-str](#serde-str)
* [serde-arbitrary-precision](#serde-arbitrary-precision)
* [std](#std)
* [serde-with-float](#serde-with-float)
* [serde-with-str](#serde-with-str)
* [serde-with-arbitrary-precision](#serde-with-arbitrary-precision)

### `c-repr`

Expand Down Expand Up @@ -133,6 +144,9 @@ Enable `rust-fuzz` support by implementing the `Arbitrary` trait.

### `serde-float`

**Note:** it is recommended to use the `serde-with-*` features for greater control. This allows configurability at the data
level.

Enable this so that JSON serialization of `Decimal` types are sent as a float instead of a string (default).

e.g. with this turned on, JSON serialization would output:
Expand All @@ -144,6 +158,9 @@ e.g. with this turned on, JSON serialization would output:

### `serde-str`

**Note:** it is recommended to use the `serde-with-*` features for greater control. This allows configurability at the data
level.

This is typically useful for `bincode` or `csv` like implementations.

Since `bincode` does not specify type information, we need to ensure that a type hint is provided in order to
Expand All @@ -156,6 +173,9 @@ converting to `f64` _loses_ precision, it's highly recommended that you do NOT e

### `serde-arbitrary-precision`

**Note:** it is recommended to use the `serde-with-*` features for greater control. This allows configurability at the data
level.

This is used primarily with `serde_json` and consequently adds it as a "weak dependency". This supports the
`arbitrary_precision` feature inside `serde_json` when parsing decimals.

Expand Down
18 changes: 18 additions & 0 deletions VERSION.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Version History

## 1.20.0

* Additional fuzz testing for deserialize ([#452](https://github.com/paupino/rust-decimal/pull/452))
* Documentation fix for rounding strategy ([#458](https://github.com/paupino/rust-decimal/pull/458))
* `from_str` is now over 4x faster, utilizing const generics and TCO ([#456](https://github.com/paupino/rust-decimal/pull/456))
* Fixed `from_str` issue with rounding issues when too many digits in source string. ([#453](https://github.com/paupino/rust-decimal/issues/453))
* New `serde-with` functionality for greater configurability when using `serde` ([#459](https://github.com/paupino/rust-decimal/pull/459))
* Various maintenance tasks ([#460](https://github.com/paupino/rust-decimal/pull/460))

This is truly a collaborative release and has some significant contributions from the community. A huge thank
you to everyone involved:

* [@chris-cantor](https://github.com/chris-cantor)
* [@TradingTomatillo](https://github.com/TradingTomatillo)
* [@c410-f3r](https://github.com/c410-f3r)
* [@ShigotoMitame](https://github.com/ShigotoMitame)
* [@luke-brown](https://github.com/luke-brown)

## 1.19.0

This is a minor dot release and contains library updates ([#334](https://github.com/paupino/rust-decimal/pull/334)) and
Expand Down
4 changes: 2 additions & 2 deletions macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rust_decimal_macros"
version = "1.19.0"
version = "1.20.0"
authors = ["Paul Mason <paul@form1.co.nz>"]
edition = "2018"
description = "Shorthand macros to assist creating Decimal types."
Expand All @@ -12,7 +12,7 @@ categories = ["science","data-structures"]
license = "MIT"

[dependencies]
rust_decimal = { path = "..", version = "1.19.0" }
rust_decimal = { path = "..", version = "1.20.0" }
quote = "1.0"

[features]
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
//!
//! ```toml
//! [dependencies]
//! rust_decimal = "1.19"
//! rust_decimal_macros = "1.19"
//! rust_decimal = "1.20"
//! rust_decimal_macros = "1.20"
//! ```
//!
//! ## Usage
Expand Down
2 changes: 2 additions & 0 deletions tests/decimal_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2893,6 +2893,8 @@ fn it_can_parse_highly_significant_numbers() {
"8097370036018690744.259037116",
),
("1.234567890123456789012345678949999", "1.2345678901234567890123456789"),
(".00000000000000000000000000001", "0.0000000000000000000000000000"),
(".10000000000000000000000000000", "0.1000000000000000000000000000"),
];
for &(value, expected) in tests {
assert_eq!(expected, Decimal::from_str(value).unwrap().to_string());
Expand Down

0 comments on commit 6d4c894

Please sign in to comment.