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)
|
.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)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue