gperftools 0.2.0

Bindings to google's gperftools
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use error::{Error, ErrorKind};
use std::path::Path;

/// Check if the provided path provides a valid file reference.
pub fn check_file_path<P: AsRef<Path>>(path: P) -> Result<(), Error> {
    match path.as_ref().parent() {
        Some(p) => {
            if p.exists() {
                Ok(())
            } else {
                Err(ErrorKind::InvalidPath.into())
            }
        }
        None => Err(ErrorKind::InvalidPath.into()),
    }
}