Skip to content

Commit 337f4f9

Browse files
committed
Format the let-else statements
1 parent 5163b56 commit 337f4f9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

examples/ws_guessing_game.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,10 @@ impl GuessingGame {
6565

6666
fn parse_guess(input: &str) -> Option<u32> {
6767
// Trim control codes (including null bytes) and/or whitespace
68-
let Ok(number) = u32::from_str_radix(input.trim_matches(|c: char| {
69-
c.is_ascii_control() || c.is_whitespace()
70-
}), 10) else {
68+
let Ok(number) = u32::from_str_radix(
69+
input.trim_matches(|c: char| c.is_ascii_control() || c.is_whitespace()),
70+
10,
71+
) else {
7172
warn!("Not a number: `{}` (length {})", input, input.len());
7273
return None;
7374
};
@@ -167,7 +168,10 @@ fn main() -> anyhow::Result<()> {
167168
};
168169

169170
let Some(user_guess) = GuessingGame::parse_guess(user_string) else {
170-
ws.send(FrameType::Text(false), "Please enter a number between 1 and 100".as_bytes())?;
171+
ws.send(
172+
FrameType::Text(false),
173+
"Please enter a number between 1 and 100".as_bytes(),
174+
)?;
171175
return Ok(());
172176
};
173177

0 commit comments

Comments
 (0)