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)
.expect("error reading user input");
if bytes_read == 0 {
None
} else {
Some(user_input)
match bytes_read {
0 => None,
_ => Some(user_input),
}
}