From 95ba26a2cd9137600a820232c72d88076da8131b Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Thu, 29 Aug 2019 10:50:18 +0300 Subject: [PATCH] Fix doctest for context creation macro Relates to #48 --- README.md | 2 +- src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2779d8c..cc7a4b7 100644 --- a/README.md +++ b/README.md @@ -268,7 +268,7 @@ use evalexpr::*; let context = context_map!{ "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)); ``` diff --git a/src/lib.rs b/src/lib.rs index 3cc08e7..c0c18c2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -255,7 +255,7 @@ //! //! let context = context_map!{ //! "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)); //! ``` //!