rpn(1): re-fixed arg parsing

This commit is contained in:
Emma Tebibyte 2024-02-02 19:17:00 -07:00
parent 6f98fdd1d4
commit 4993c53080
Signed by: emma
GPG Key ID: 06FA419A1698C270

View File

@ -137,7 +137,7 @@ fn eval(
// Split the input into tokens. // Split the input into tokens.
let mut toks: VecDeque<CalcType> = input let mut toks: VecDeque<CalcType> = input
.split(' ') .split_whitespace()
.rev() .rev()
.map(|t| CalcType::from(t)) .map(|t| CalcType::from(t))
.collect(); .collect();
@ -223,7 +223,6 @@ fn main() -> ExitCode {
let input = argv let input = argv
.iter() .iter()
.skip(1) .skip(1)
.rev()
.map(|x| x.to_owned()) .map(|x| x.to_owned())
.collect::<Vec<String>>() .collect::<Vec<String>>()
.join(" "); .join(" ");