read_number

Function read_number 

Source
pub fn read_number() -> i32
Expand description

Reads a number from the standard input. The function loops indefinitely until a valid number is provided. If the End-Of-File is reached, the function panics.

§Panics

This function panics if it fails to read from the standard input of the program.

§Examples

println!("How old are you?");
let age = ftkit::read_number();
println!("Oh? So you are {age} year(s) old?");