Note: This site is currently "Under construction". I'm migrating to a new version of my site building software. Lots of things are in a state of disrepair as a result (for example, footnote links aren't working). It's all part of the process of building in public. Most things should still be readable though.

Do A Case Insensitive glob Director Search In Rust

Code

//! ```cargo
//! [dependencies]
//! glob = "0.3.1"
//! ```

use glob::glob_with;
use glob::MatchOptions;

fn main() {
  let options = MatchOptions {
      case_sensitive: false,
      require_literal_separator: false,
      require_literal_leading_dot: false,
  };
  for entry in glob_with("glob_test/*o*", options).unwrap() {
      if let Ok(path) = entry {
          println!("{:?}", path.display())
      }
  }
}

Results

"glob_test/BRAVO.txt"
"glob_test/echo.txt"
"glob_test/fOxtrOt.txt"
"glob_test/golf.txt"
"glob_test/hotel.txt"