summaryrefslogtreecommitdiff
path: root/src/rpn.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/rpn.rs')
-rw-r--r--src/rpn.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rpn.rs b/src/rpn.rs
index 6ac0dec..dbed3db 100644
--- a/src/rpn.rs
+++ b/src/rpn.rs
@@ -29,7 +29,7 @@ fn rpn_match_op(c: char) -> Option<RpnOperation> {
///
/// Returns `f32` arithmetic result if the expression can be parsed
/// Returns `Err` with a message if the RPN expression is malformed
-pub fn eval(rpn_str: String, var_map: HashMap<char, f32>) -> Result<f32, String> {
+pub fn eval(rpn_str: &str, var_map: HashMap<char, f32>) -> Result<f32, String> {
let mut stack: Vec<f32> = vec![];
for (_i, ch) in rpn_str.chars().enumerate() {
// println!("Parsing: {}, Stack: {:?}", ch, stack);