From 0e79d25d7d175dc71378a364b51aa981af7f8997 Mon Sep 17 00:00:00 2001 From: Ahurac Date: Tue, 9 Apr 2024 12:20:09 +0200 Subject: [PATCH] main : traitement EOF --- src/main.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.rs b/src/main.rs index dac07c4..4ac8bc8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,5 +18,10 @@ fn main() { bytes_read = io::stdin() .read_line(&mut user_input) .expect("error reading user input"); + + if bytes_read == 0 { + println!(); + exit(); + } } }