From 9dd8f90e3c3d5776c69b8520733198ccec9e0142 Mon Sep 17 00:00:00 2001 From: greg Date: Mon, 20 Feb 2017 20:14:59 -0800 Subject: [PATCH] Only print last evaluated result --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index f8cbb77..a701231 100644 --- a/src/main.rs +++ b/src/main.rs @@ -124,8 +124,8 @@ fn run_noninteractive<'a, T: ProgrammingLanguage>(filename: &str, _language: &T, evaluator.set_option("trace_evaluation", true); } let results = T::evaluate(ast, &mut evaluator); - for result in results.iter() { - println!("{}", result); + if let Some(r) = results.iter().last() { + println!("{}", r); } } }