simple/simple.rs
1extern crate whereami;
2
3use std::path::PathBuf;
4
5
6fn print_path(name: &str, path: Option<PathBuf>) {
7 match path {
8 Some(path) => println!("{}: {}", name, path.to_str().unwrap()),
9 None => println!("Couldn't determine {} path", name),
10 }
11}
12
13
14fn main() {
15 print_path("executable", whereami::executable_path());
16 print_path("module", whereami::module_path());
17}