File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments