Last active
June 26, 2017 15:00
-
-
Save fivetanley/d36cd0627105a393d4a7869c708f7fd0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| extern crate glob; | |
| use glob::glob; | |
| use std::fs; | |
| use std::path; | |
| // trying to print out only directories | |
| fn main() { | |
| // the .unwrap here should convert a Result<PathBuf, GlobError> to | |
| // just the PathBuf, which you should be able to call .is_dir() on? | |
| let files = glob("/Users/sstuart/src/dashboard4/app/**/*") | |
| .expect("Failed to read glob pattern") | |
| .filter( |x| x.clone().unwrap().is_dir()); | |
| for entry in files { | |
| println!("{:?}", entry); | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
compiler output: