mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-11 21:29:18 +00:00
adding wrong input type handling. finished.
This commit is contained in:
parent
248972ed04
commit
700d6ba478
@ -17,7 +17,10 @@ fn main() {
|
|||||||
|
|
||||||
let guess: u32 = match guess.trim().parse() {
|
let guess: u32 = match guess.trim().parse() {
|
||||||
Ok(num) => num,
|
Ok(num) => num,
|
||||||
Err(_) => continue,
|
Err(_) => {
|
||||||
|
println!("Please input an integer!\n");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
println!("You guessed : {}", guess);
|
println!("You guessed : {}", guess);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user