diff --git a/src/tools.rs b/src/tools.rs index 71ac32c..c44598a 100644 --- a/src/tools.rs +++ b/src/tools.rs @@ -37,7 +37,7 @@ pub unsafe fn from_cstr_ref<'a>(p: *const c_char) -> Option> { // Create CString from &Path pub fn path_to_cstr(path: &Path) -> Result { - let path = try!(CString::new(path.to_string_lossy().into_owned())); - + let path = CString::new(path.to_string_lossy().into_owned())?; + Ok(path) }