diff --git a/guessing_game/src/main.rs b/guessing_game/src/main.rs index c5601cb..a58990e 100644 --- a/guessing_game/src/main.rs +++ b/guessing_game/src/main.rs @@ -22,7 +22,10 @@ fn main() { match guess.cmp(&secret_number) { Ordering::Less => println!("Too small!"), Ordering::Greater => println!("Too big!"), - Ordering::Equal => println!("You win!"), + Ordering::Equal => { + println!("You win!"); + break; + }, } } }