Skip to content

Commit

Permalink
Merge pull request #272 from adamreichold/explain-serde-opt-deps
Browse files Browse the repository at this point in the history
Explain how to manually enable Serde support for num-rational and num-bigint
  • Loading branch information
iliekturtles committed Mar 17, 2022
2 parents fe7f0b3 + 4f6aba1 commit 66a0546
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 66a0546

Please sign in to comment.