aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar alecdwm 2019-12-05 13:42:45 +1000
committerGravatar alecdwm 2019-12-05 13:42:50 +1000
commitceaef713f847d7bc267de6090ba9480c60741bb3 (patch)
tree84ae0cb61b790f9cec786856c306a22ff036f752
parent7657664485f668d2de1878fa790c08d1dec89e6b (diff)
ignore empty lines before puzzle input in read_stdin_to_string
-rw-r--r--src/common.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/common.rs b/src/common.rs
index 656aa30..c11e55e 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -9,6 +9,9 @@ pub fn read_stdin_to_string() -> String {
loop {
io::stdin().read_line(&mut line).unwrap();
if line.trim() == "" {
+ if input.trim() == "" {
+ continue;
+ }
break;
}
input.push_str(&line);