Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- println!("{:?}", {
- Some(10).iter().zip(Some(1).iter()).map(|a, b| a + b).next()
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (file:///playground)
- error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments
- --> src/main.rs:5:45
- |
- 5 | Some(10).iter().zip(Some(1).iter()).map(|a, b| a + b).next()
- | ^^^ ------ takes 2 distinct arguments
- | |
- | expected closure that takes a single 2-tuple as argument
- help: change the closure to accept a tuple instead of individual arguments
- |
- 5 | Some(10).iter().zip(Some(1).iter()).map(|(a, b)| a + b).next()
- | ^^^^^^^^
- error: aborting due to previous error
- For more information about this error, try `rustc --explain E0593`.
- error: Could not compile `playground`.
- To learn more, run the command again with --verbose.
- */
- /* ~~~~=== stdout ===~~~~
- */
Add Comment
Please, Sign In to add comment