From 4f6aba105fb5b9670199594183185521f8ffe350 Mon Sep 17 00:00:00 2001 From: Adam Reichold Date: Tue, 14 Sep 2021 21:26:55 +0200 Subject: [PATCH] Explain how to manually enable Serde support for num-rational and num-bigint. --- README.md | 9 +++++++++ src/lib.rs | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/README.md b/README.md index 00380de3..0b924596 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,15 @@ uom = { * `use_serde` -- Feature to enable support for serialization and deserialization of quantities with the [Serde][serde] crate. Disabled by default. + [Serde][serde] support for the `big*` and `rational*` underlying storage types requires manually + enabling the `serde` feature for the `num-rational` and `num-bigint` crates. To do so, you can + add one or both of the following lines to your `Cargo.toml`: + + ```toml + num-rational = { version = "*", features = ["serde"] } + num-bigint = { version = "*", features = ["serde"] } + ``` + [si]: https://jcgm.bipm.org/vim/en/1.16.html [serde]: https://serde.rs/ diff --git a/src/lib.rs b/src/lib.rs index 994f2d6b..be430b4a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -98,6 +98,15 @@ //! * `use_serde` -- Feature to enable support for serialization and deserialization of quantities //! with the [Serde][serde] crate. Disabled by default. //! +//! [Serde][serde] support for the `big*` and `rational*` underlying storage types requires +//! manually enabling the `serde` feature for the `num-rational` and `num-bigint` crates. To do +//! so, you can add one or both of the following lines to your `Cargo.toml`: +//! +//! ```toml +//! num-rational = { version = "*", features = ["serde"] } +//! num-bigint = { version = "*", features = ["serde"] } +//! ``` +//! //! [si]: https://jcgm.bipm.org/vim/en/1.16.html //! [serde]: https://serde.rs/ //!