From fbe72d3f55b64df12ecbf4739b60a7b0a39a0828 Mon Sep 17 00:00:00 2001 From: PaddiM8 Date: Fri, 12 Jun 2020 14:10:10 +0200 Subject: [PATCH] Fixed code in documentation in parser.rs --- kalk/src/parser.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kalk/src/parser.rs b/kalk/src/parser.rs index 74c2ced..47de1fe 100644 --- a/kalk/src/parser.rs +++ b/kalk/src/parser.rs @@ -9,8 +9,10 @@ use rug::Float; /// Struct containing the current state of the parser. It stores user-defined functions and variables. /// # Examples /// ``` -/// let parser_context = parser::Context::new(); -/// assert_eq!(parser_context.eval("5*3").unwrap().unwrap(), 15); +/// use kalk::parser; +/// let mut parser_context = parser::Context::new(); +/// let precision = 53; +/// assert_eq!(parser::eval(&mut parser_context, "5*3", precision).unwrap().unwrap(), 15); /// ``` pub struct Context { tokens: Vec,