daily pastebin goal
66%
SHARE
TWEET

Untitled

a guest Dec 12th, 2018 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top