main : traitement EOF

This commit is contained in:
Ahurac 2024-04-09 12:20:09 +02:00
parent cf76069979
commit 0e79d25d7d

View file

@ -18,5 +18,10 @@ fn main() {
bytes_read = io::stdin() bytes_read = io::stdin()
.read_line(&mut user_input) .read_line(&mut user_input)
.expect("error reading user input"); .expect("error reading user input");
if bytes_read == 0 {
println!();
exit();
}
} }
} }