Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Sometimes you need a different type and you don't care about the intermediate values. Parsing a string into an integer is a good example. Once you have the integer, generally you don't care to use the string anymore.

  let num = String::from("10");
  let num: i32 = num.parse().unwrap();


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: