From 3e6dc5cc46114ba19077e6a0486b635ffdb49805 Mon Sep 17 00:00:00 2001 From: emma Date: Fri, 1 Mar 2024 23:14:18 -0700 Subject: [PATCH] rpn(1): make error messages consistent with other tools --- src/rpn.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rpn.rs b/src/rpn.rs index 0cb23b8..8ccf5d6 100644 --- a/src/rpn.rs +++ b/src/rpn.rs @@ -52,8 +52,10 @@ use std::{ use CalcType::*; +extern crate strerror; extern crate sysexits; +use strerror::c_error; use sysexits::EX_DATAERR; #[derive(Clone, PartialEq, PartialOrd, Debug)] @@ -172,7 +174,7 @@ fn eval( }; } else { return Err(EvaluationError { - message: format!("{}: Unexpected operation.", op), + message: format!("{}: Unexpected operation", op), code: EX_DATAERR, }) }