Skip to content

Instantly share code, notes, and snippets.

@drewdeponte
Created September 6, 2017 22:30
Show Gist options
  • Save drewdeponte/907bb036bb8851c564f34410113abb73 to your computer and use it in GitHub Desktop.
Save drewdeponte/907bb036bb8851c564f34410113abb73 to your computer and use it in GitHub Desktop.
fn get_possible_files_from_glob<T: Iterator<Item=Option<String>>>() -> Result<T, glob::PatternError> {
glob("**/*").map(|paths| paths.flat_map(identity).filter(|path| path.is_file()).map(|path_buf| path_buf.to_str()))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment