summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--lib/src/lib.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/src/lib.rs b/lib/src/lib.rs
index 5f87317..d09e357 100644
--- a/lib/src/lib.rs
+++ b/lib/src/lib.rs
@@ -27,7 +27,14 @@ pub fn read_lines_file(filename: &str) -> Result<Vec<String>> {
     }
 
     let mut line_copy = String::new();
-    line_copy.push_str(buffer.trim());
+    match buffer.strip_suffix("\n") {
+      Some(stripped) => {
+        line_copy.push_str(stripped);
+      }
+      None => {
+        line_copy.push_str(&buffer);
+      }
+    }
     input.push(line_copy);
 
     buffer.clear();