mirror of
https://github.com/mrfluffy-dev/kami.git
synced 2026-01-17 12:50:32 +00:00
Did more refacroring and made a better loop for anime as well as error handeling in anime
This commit is contained in:
@@ -17,7 +17,13 @@ pub fn int_input(prompt: &str) -> usize {
|
||||
io::stdin()
|
||||
.read_line(&mut input)
|
||||
.expect("Error reading from STDIN");
|
||||
input.trim().parse::<usize>().unwrap()
|
||||
//try to parse the input as usize else return max usize
|
||||
match input.trim().parse::<usize>() {
|
||||
Ok(i) => i,
|
||||
Err(_) => {
|
||||
usize::max_value()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn u16_input(prompt: &str) -> u16 {
|
||||
|
||||
Reference in New Issue
Block a user