box-o-sand/rustbyexample/conversion.d/string2.rs

8 lines
181 B
Rust

fn main() {
let parsed: i32 = "5".parse().unwrap();
let turbo_parsed = "10".parse::<i32>().unwrap();
let sum = parsed + turbo_parsed;
println!("Sum: {:?}", sum);
}