From 763c2b256482949ea496a1efbb9bcf3185e58ddd Mon Sep 17 00:00:00 2001 From: Alex Orlenko Date: Sun, 10 Aug 2025 00:20:20 +0100 Subject: [PATCH] Update `repl` example: don't print newline if no values returned --- examples/repl.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/examples/repl.rs b/examples/repl.rs index c0a34a6..98355ce 100644 --- a/examples/repl.rs +++ b/examples/repl.rs @@ -20,14 +20,16 @@ fn main() { match lua.load(&line).eval::() { Ok(values) => { editor.add_history_entry(line).unwrap(); - println!( - "{}", - values - .iter() - .map(|value| format!("{:#?}", value)) - .collect::>() - .join("\t") - ); + if values.len() > 0 { + println!( + "{}", + values + .iter() + .map(|value| format!("{:#?}", value)) + .collect::>() + .join("\t") + ); + } break; } Err(Error::SyntaxError {