Function libmacchina::extra::is_int [−][src]
Expand description
This function checks if the given String
is a valid integer,
returning an error message if the check fails.
Example
use libmacchina::extra::is_int;
let a = String::from("123");
let b = String::from("ABC123");
assert_eq!(is_int(a).is_ok(), true);
assert_eq!(is_int(b).is_ok(), false);