Skip to content

Commit

Permalink
add walkdir
Browse files Browse the repository at this point in the history
fixes #32
  • Loading branch information
davidpeklak committed Jun 20, 2017
1 parent 90d7961 commit a99df1e
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 33,7 @@ tempdir = "0.3.5"
tar = "0.4.13"
toml = "0.4.1"
url = "1.4.1"
walkdir = "1.0.7"

# Supplemental dependencies
env_logger = "0.4.3"
Expand Down
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 26,11 @@ Current revision: `stdx` 0.118.0-rc, for Rust 1.18, June 8, 2017.
| HTTP client | [`reqwest = "0.6.2"`] | [📖][d-reqwest] |
| Serialization | [`serde = "1.0.8"`] | [📖][d-serde] |
| JSON | [`serde_json = "1.0.2"`] | [📖][d-serde_json] |
| Tar archives | [`tar = "0.4.13"`] | [📖][d-tar] |
| Tar archives | [`tar = "0.4.13"`] | [📖][d-tar] |
| Temporary directories | [`tempdir = "0.3.5"`] | [📖][d-tempdir] |
| Configuration files | [`toml = "0.4.1"`] | [📖][d-toml] |
| URLs | [`url = "1.4.1"`] | [📖][d-url] |
| Walking directories recursively| [`walkdir = "1.0.7"`] | [📖][d-walkdir] |

 
 
 


Expand Down Expand Up @@ -939,6 940,34 @@ fn main() {
 
 
 



<a id="walkdir"></a>
### `walkdir = "1.0.7"` &emsp; [📖][d-walkdir]

A cross platform Rust library for efficiently walking a directory recursively.

**Example**: [`examples/walkdir.rs`]

```rust
extern crate walkdir;

use walkdir::{WalkDir, Error};

fn run(wd: WalkDir) -> Result<(), Error> {
for entry in wd {
let entry = entry?;
println!("{}", entry.path().display());
}
Ok(())
}

fn main() {
run(WalkDir::new(".")).unwrap();
}
```

&nbsp;&NewLine;&nbsp;&NewLine;&nbsp;&NewLine;


## About `stdx`

Rust has a lovely and portable standard library, but it is not
Expand Down Expand Up @@ -1131,6 1160,7 @@ copyright is owned by its contributors.
[`tar = "0.4.13"`]: #tar
[`toml = "0.4.1"`]: #toml
[`url = "1.4.1"`]: #url
[`walkdir = "1.0.7"`]: #walkdir

<!-- stdx crate doc links -->

Expand All @@ -1156,6 1186,7 @@ copyright is owned by its contributors.
[d-tempdir]: https://docs.rs/tempdir/0.3.5/tempdir/
[d-toml]: https://docs.rs/toml/0.4.1/toml/
[d-url]: https://docs.rs/url/1.4.1/url/
[d-walkdir]: https://docs.rs/walkdir/1/walkdir/

<!-- examples -->

Expand All @@ -1180,6 1211,7 @@ copyright is owned by its contributors.
[`examples/tempdir.rs`]: examples/tempdir.rs
[`examples/toml.rs`]: examples/toml.rs
[`examples/url.rs`]: examples/url.rs
[`examples/walkdir.rs`]: examples/walkdir.rs

<!-- Supplemental crates -->

Expand Down
15 changes: 15 additions & 0 deletions examples/walkdir.rs
Original file line number Diff line number Diff line change
@@ -0,0 1,15 @@
extern crate walkdir;

use walkdir::{WalkDir, Error};

fn run(wd: WalkDir) -> Result<(), Error> {
for entry in wd {
let entry = entry?;
println!("{}", entry.path().display());
}
Ok(())
}

fn main() {
run(WalkDir::new(".")).unwrap();
}

0 comments on commit a99df1e

Please sign in to comment.