How do I convert a boolean to an integer in Rust? As in, true becomes 1, and false becomes 0.
true
false
Cast it:
fn main() { println!("{}", true as i32) }