Skip to content

Commit fc308b1

Browse files
authored
Merge pull request #60 from rap2hpoutre/patch-1
Add example in readme
2 parents 0704f0d + 389c120 commit fc308b1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,17 @@ And add this to your crate root:
2222
extern crate glob;
2323
```
2424

25+
## Examples
26+
27+
Print all jpg files in /media/ and all of its subdirectories.
28+
29+
```rust
30+
use glob::glob;
31+
32+
for entry in glob("/media/**/*.jpg").expect("Failed to read glob pattern") {
33+
match entry {
34+
Ok(path) => println!("{:?}", path.display()),
35+
Err(e) => println!("{:?}", e),
36+
}
37+
}
38+
```

0 commit comments

Comments
 (0)