From 24ca11e52a2f0f9ec53331439d5812d6165b4d78 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Wed, 27 Mar 2019 18:34:49 +0100 Subject: [PATCH] Document how to enable serde feature flag Relates to #21 --- README.md | 8 ++++++++ src/lib.rs | 8 ++++++++ 2 files changed, 16 insertions(+) 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):