fix compile in stable.

This commit is contained in:
fengcen 2016-11-22 07:51:18 +08:00
parent 39dca976ae
commit c2e3401c74
3 changed files with 13 additions and 6 deletions

View File

@ -1,6 +1,6 @@
[package] [package]
name = "eval" name = "eval"
version = "0.3.0" version = "0.3.1"
description = "Expression evaluator" description = "Expression evaluator"
keywords = ["expression", "evaluate", "evaluator", "expr", "template"] keywords = ["expression", "evaluate", "evaluator", "expr", "template"]
authors = ["fengcen <fengcen.love@gmail.com>"] authors = ["fengcen <fengcen.love@gmail.com>"]
@ -18,3 +18,6 @@ path = "src/lib.rs"
serde = "^0.8" serde = "^0.8"
serde_json = "^0.8" serde_json = "^0.8"
quick-error = "^1.1" quick-error = "^1.1"
[features]
unstable = []

View File

@ -1,7 +1,7 @@
eval eval
=== ====
[![docs](https://docs.rs/eval/badge.svg?version=0.3.0 "docs")](https://docs.rs/eval) [![docs](https://docs.rs/eval/badge.svg?version=0.3.1 "docs")](https://docs.rs/eval)
Eval is a powerful expression evaluator. Eval is a powerful expression evaluator.

View File

@ -92,8 +92,7 @@
//! //!
#![recursion_limit="100"] #![recursion_limit="100"]
#![deny(missing_docs)] #![deny(missing_docs)]
#![feature(proc_macro, test)] #![cfg_attr(feature = "unstable", feature(test))]
extern crate test;
#[macro_use] #[macro_use]
extern crate quick_error; extern crate quick_error;
@ -135,7 +134,6 @@ type Compiled = Box<Fn(&[Context], &Functions) -> Result<Value, Error>>;
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use test;
use serde_json::to_value; use serde_json::to_value;
use error::Error; use error::Error;
use Expr; use Expr;
@ -542,7 +540,13 @@ mod tests {
assert_eq!(tree.parse_node(), Err(Error::CommaNotWithFunction)); assert_eq!(tree.parse_node(), Err(Error::CommaNotWithFunction));
} }
}
#[cfg(all(feature = "unstable", test))]
mod benches {
extern crate test;
use eval;
use tree::Tree;
#[bench] #[bench]
fn bench_deep_brackets(b: &mut test::Bencher) { fn bench_deep_brackets(b: &mut test::Bencher) {