Created
March 18, 2018 20:14
-
-
Save grahamc/85915e66c65512c8598abf25bc610d43 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let (ok, err): ( | |
Vec<Result<String, (String, Vec<String>)>>, | |
Vec<Result<String, (String, Vec<String>)>>) = attr_instantiations | |
.into_iter() | |
.partition(|x| x.is_ok()); | |
let ok_ret: Vec<String> = ok.into_iter().map(|x| x.unwrap()).collect(); | |
let err_ret: Vec<(String, Vec<String>)> = err.into_iter().map(|x| x.unwrap_err()).collect(); | |
return ( | |
ok_ret, | |
err_ret | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment