Guest User

Untitled

a guest
Dec 12th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. fn main() {
  2. let numbers: Result<Vec<_>, std::num::ParseIntError> = "12\n42\n89"
  3. .lines()
  4. .map(|line| {
  5. let x: i32 = line.parse()?;
  6. Ok(x + 1)
  7. })
  8. .collect();
  9.  
  10. println!("{:?}", numbers);
  11. }
Add Comment
Please, Sign In to add comment