commit | d0a666aa5b1cdb5d9d06a4592782bfd6eb887b29 | [log] [tgz] |
---|---|---|
author | Matthew Maurer <[email protected]> | Thu Mar 09 18:06:43 2023 +0000 |
committer | Automerger Merge Worker <[email protected]> | Thu Mar 09 18:06:43 2023 +0000 |
tree | 1b1ba7f0a897cdeda990520838f863cbaf2a3276 | |
parent | 5b7dc8a802a2e95492dbd4d92a273671fccdfbd5 [diff] | |
parent | 7a979c00c82ea4aa81d776dcc52b521d54b09dba [diff] |
Make glob available to product and vendor am: f159f2a269 am: 3085af969b am: 47b1279e33 am: 7a979c00c8 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/glob/+/2476424 Change-Id: I7d1e88f283009114443ecfc377c6682acfd0ac3f Signed-off-by: Automerger Merge Worker <[email protected]>
Support for matching file paths against Unix shell style patterns.
To use glob
, add this to your Cargo.toml
:
[dependencies] glob = "0.3.1"
And add this to your crate root:
extern crate glob;
Print all jpg files in /media/ and all of its subdirectories.
use glob::glob; for entry in glob("/media/**/*.jpg").expect("Failed to read glob pattern") { match entry { Ok(path) => println!("{:?}", path.display()), Err(e) => println!("{:?}", e), } }