Migrate 26 crates to monorepo am: 186abdd35f am: 47344d244c

Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/which/+/3272315

Change-Id: If92bad8f6d333eb31858edf9eed5570329ef85f1
Signed-off-by: Automerger Merge Worker <[email protected]>
tree: de627b142f5175c11ec2c6d07263e2070dab5e11
  1. .github/
  2. src/
  3. tests/
  4. .cargo_vcs_info.json
  5. .gitignore
  6. Android.bp
  7. Cargo.toml
  8. Cargo.toml.orig
  9. LICENSE.txt
  10. METADATA
  11. MODULE_LICENSE_MIT
  12. OWNERS
  13. README.md
README.md

Build Status

which

A Rust equivalent of Unix command “which”. Locate installed executable in cross platforms.

Support platforms

  • Linux
  • Windows
  • macOS

Examples

  1. To find which rustc executable binary is using.

    use which::which;
    
    let result = which("rustc").unwrap();
    assert_eq!(result, PathBuf::from("/usr/bin/rustc"));
    
  1. After enabling the regex feature, find all cargo subcommand executables on the path:

    use which::which_re;
    
    which_re(Regex::new("^cargo-.*").unwrap()).unwrap()
        .for_each(|pth| println!("{}", pth.to_string_lossy()));
    

Documentation

The documentation is available online.