Skip to content

Instantly share code, notes, and snippets.

@tbillington
Last active August 29, 2015 14:20
Show Gist options
  • Save tbillington/9a33f8ea44d8a243688d to your computer and use it in GitHub Desktop.
Save tbillington/9a33f8ea44d8a243688d to your computer and use it in GitHub Desktop.
Rust unpacking
let r2: Result<((String, (Vec<&str>, Vec<char>)), &str), ParseError> = heading.parse("** r&wr");
println!("{:?}", r2);
let ((r3, (_, _)), _, _) = r2;
println!("{:?}", r3);
src/main.rs:50:9: 50:29 error: mismatched types:
expected `core::result::Result<((collections::string::String, (collections::vec::Vec<&str>, collections::vec::Vec<char>)), &str), parser_combinators::primitives::ParseError>`,
found `(_, _, _)`
(expected enum `core::result::Result`,
found tuple) [E0308]
src/main.rs:50 let ((r3, (_, _)), _, _) = r2;//.clone().map(|x| r2.ok().unwrap());
^~~~~~~~~~~~~~~~~~~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment