interface : remplacement du if par un match plus lisible

This commit is contained in:
Ahurac 2024-04-17 10:25:32 +02:00
parent fdcaa99feb
commit 5584f49c87

View file

@ -15,9 +15,8 @@ pub fn get_user_input() -> Option<String> {
.read_line(&mut user_input) .read_line(&mut user_input)
.expect("error reading user input"); .expect("error reading user input");
if bytes_read == 0 { match bytes_read {
None 0 => None,
} else { _ => Some(user_input),
Some(user_input)
} }
} }