~janbaudisch/aoc-2019

d9ec11106af26574a8d676b24b4c5070555f8d48 — Jan Baudisch 4 years ago c1208e5
common: add windows newline
1 files changed, 6 insertions(+), 1 deletions(-)

M common/src/input.rs
M common/src/input.rs => common/src/input.rs +6 -1
@@ 1,5 1,10 @@
use std::io;

#[cfg(not(target_os = "windows"))]
static NEWLINE: &str = "\n";
#[cfg(target_os = "windows")]
static NEWLINE: &str = "\r\n";

pub fn read_line() -> String {
    let mut input = String::new();



@@ 21,7 26,7 @@ pub fn read_lines() -> Vec<String> {

        match io::stdin().read_line(&mut input) {
            Ok(_) => {
                if input == "\n" {
                if input == NEWLINE {
                    break;
                }