From bde5163367c8631226ac9eeb41cde985cc4ad24f Mon Sep 17 00:00:00 2001 From: Alexandre Janniaux Date: Fri, 15 Nov 2019 13:17:32 +0100 Subject: [PATCH] tools: use ? instead of try --- src/tools.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) }