Fix doctest for context creation macro

Relates to #48
This commit is contained in:
Sebastian Schmidt 2019-08-29 10:50:18 +03:00
parent 60b6cdf180
commit 95ba26a2cd
2 changed files with 2 additions and 2 deletions

View File

@ -268,7 +268,7 @@ use evalexpr::*;
let context = context_map!{ let context = context_map!{
"f" => Function::new(Box::new(|args| Ok(Value::from(args.as_int()? + 5)))), "f" => Function::new(Box::new(|args| Ok(Value::from(args.as_int()? + 5)))),
}; }.unwrap_or_else(|error| panic!("Error creating context: {}", error));
assert_eq!(eval_int_with_context("f 5", &context), Ok(10)); assert_eq!(eval_int_with_context("f 5", &context), Ok(10));
``` ```

View File

@ -255,7 +255,7 @@
//! //!
//! let context = context_map!{ //! let context = context_map!{
//! "f" => Function::new(Box::new(|args| Ok(Value::from(args.as_int()? + 5)))), //! "f" => Function::new(Box::new(|args| Ok(Value::from(args.as_int()? + 5)))),
//! }; //! }.unwrap_or_else(|error| panic!("Error creating context: {}", error));
//! assert_eq!(eval_int_with_context("f 5", &context), Ok(10)); //! assert_eq!(eval_int_with_context("f 5", &context), Ok(10));
//! ``` //! ```
//! //!