dlib-face-recognition 0.3.2

Unofficial Rust wrappers to the C++ library dlib, face recognition tools
1
2
3
4
5
6
7
8
9
10
11
use std::ffi::*;
use std::path::*;

pub fn path_as_cstring(path: &Path) -> Result<CString, String> {
    if !path.exists() {
        Err(format!("File not found: '{}'", path.display()))
    } else {
        let string = path.to_str().unwrap();
        Ok(CString::new(string).unwrap())
    }
}