Skip to content

Commit

Permalink
Explain how to manually enable Serde support for num-rational and num…
Browse files Browse the repository at this point in the history
…-bigint.
  • Loading branch information
adamreichold committed Mar 17, 2022
1 parent fe7f0b3 commit 4f6aba1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/

Expand Down
9 changes: 9 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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/
//!
Expand Down

0 comments on commit 4f6aba1

Please sign in to comment.