loop { | loop { | ||||
let mut buffer = String::new(); | let mut buffer = String::new(); | ||||
match std::io::stdin().read_line(&mut buffer){ | |||||
Ok(_n) => { | |||||
match std::io::stdin().read_line(&mut buffer) { | |||||
Ok(n) => { | |||||
if n == 0 { | |||||
break; | |||||
} | |||||
println!("{}", buffer); | println!("{}", buffer); | ||||
} | } | ||||
Err(_error) =>{ | |||||
Err(_error) => { | |||||
println!("Fehlerhafte Eingabe!"); | println!("Fehlerhafte Eingabe!"); | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} // the stream is closed here | |||||
} // the stream is closed here |