aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md23
1 files changed, 7 insertions, 16 deletions
diff --git a/README.md b/README.md
index 5615c36..f20f929 100644
--- a/README.md
+++ b/README.md
@@ -10,25 +10,16 @@ A Rust equivalent of Unix command "which". Locate installed executable in cross
* Windows
* macOS
-## Examples
+## Example
-1) To find which rustc executable binary is using.
+To find which rustc exectable binary is using.
- ``` rust
- use which::which;
+``` rust
+use which::which;
- let result = which("rustc").unwrap();
- assert_eq!(result, PathBuf::from("/usr/bin/rustc"));
- ```
-
-2. After enabling the `regex` feature, find all cargo subcommand executables on the path:
-
- ``` rust
- use which::which_re;
-
- which_re(Regex::new("^cargo-.*").unwrap()).unwrap()
- .for_each(|pth| println!("{}", pth.to_string_lossy()));
- ```
+let result = which::which("rustc").unwrap();
+assert_eq!(result, PathBuf::from("/usr/bin/rustc"));
+```
## Documentation