Guest User

Untitled

a guest
Jul 15th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. fn main() {
  2. println!("{:?}", {
  3. Some(10).iter().zip(Some(1).iter()).map(|a, b| a + b).next()
  4. });
  5. }
  6.  
  7.  
  8. /* ~~~~=== stderr ===~~~~
  9. Compiling playground v0.0.1 (file:///playground)
  10. error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments
  11. --> src/main.rs:5:45
  12. |
  13. 5 | Some(10).iter().zip(Some(1).iter()).map(|a, b| a + b).next()
  14. | ^^^ ------ takes 2 distinct arguments
  15. | |
  16. | expected closure that takes a single 2-tuple as argument
  17. help: change the closure to accept a tuple instead of individual arguments
  18. |
  19. 5 | Some(10).iter().zip(Some(1).iter()).map(|(a, b)| a + b).next()
  20. | ^^^^^^^^
  21.  
  22. error: aborting due to previous error
  23.  
  24. For more information about this error, try `rustc --explain E0593`.
  25. error: Could not compile `playground`.
  26.  
  27. To learn more, run the command again with --verbose.
  28.  
  29. */
  30.  
  31. /* ~~~~=== stdout ===~~~~
  32.  
  33. */
Add Comment
Please, Sign In to add comment