From ac576be604f31206ccb7cf5f43e437bb8d0c99c1 Mon Sep 17 00:00:00 2001 From: greg Date: Sat, 12 May 2018 14:00:48 -0700 Subject: [PATCH] Trim newline in getline() Ineffiicent but whatever --- schala-lang/src/eval.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schala-lang/src/eval.rs b/schala-lang/src/eval.rs index a0a418e..6273e84 100644 --- a/schala-lang/src/eval.rs +++ b/schala-lang/src/eval.rs @@ -454,7 +454,7 @@ impl<'a> State<'a> { ("getline", &[]) => { let mut buf = String::new(); io::stdin().read_line(&mut buf).expect("Error readling line in 'getline'"); - Lit(StringLit(Rc::new(buf))) + Lit(StringLit(Rc::new(buf.trim().to_string()))) }, (x, args) => return Err(format!("bad or unimplemented builtin {:?} | {:?}", x, args)), })