interface : remplacement du if par un match plus lisible
This commit is contained in:
parent
fdcaa99feb
commit
5584f49c87
1 changed files with 3 additions and 4 deletions
|
@ -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),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue