Skip to content

Instantly share code, notes, and snippets.

@grahamc
Created March 18, 2018 20:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grahamc/85915e66c65512c8598abf25bc610d43 to your computer and use it in GitHub Desktop.
Save grahamc/85915e66c65512c8598abf25bc610d43 to your computer and use it in GitHub Desktop.
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