diff --git a/README.md b/README.md index 01909bb..62a201d 100644 --- a/README.md +++ b/README.md @@ -246,6 +246,14 @@ Functions have a precedence of 190. ### [Serde](https://serde.rs) +To use this crate with serde, the serde feature flag has to be set. +This can be done like this in the `Cargo.toml`: + +```toml +[dependencies] +evalexpr = {version = "1", features = ["serde"]} +``` + This crate implements `serde::de::Deserialize` for its type `Node` that represents a parsed expression tree. The implementation expects a [serde `string`](https://serde.rs/data-model.html) as input. Example parsing with [ron format](docs.rs/ron): diff --git a/src/lib.rs b/src/lib.rs index f42379a..87aee07 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -233,6 +233,14 @@ //! //! ### [Serde](https://serde.rs) //! +//! To use this crate with serde, the serde feature flag has to be set. +//! This can be done like this in the `Cargo.toml`: +//! +//! ```toml +//! [dependencies] +//! evalexpr = {version = "1", features = ["serde"]} +//! ``` +//! //! This crate implements `serde::de::Deserialize` for its type `Node` that represents a parsed expression tree. //! The implementation expects a [serde `string`](https://serde.rs/data-model.html) as input. //! Example parsing with [ron format](docs.rs/ron):