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)); //! ``` //!