From 51dd65627267b251c5c73c9a95e76a8ea20c47fd Mon Sep 17 00:00:00 2001 From: hh9527 Date: Thu, 17 Nov 2016 12:46:24 +0800 Subject: [PATCH] Fix compile failed in stable/beta --- src/ffi_util.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ffi_util.rs b/src/ffi_util.rs index 07c3bff..9256845 100644 --- a/src/ffi_util.rs +++ b/src/ffi_util.rs @@ -18,7 +18,7 @@ use std::ffi::CStr; pub fn error_message(ptr: *const c_char) -> String { let cstr = unsafe { CStr::from_ptr(ptr as *const _) }; - let s = String::from_utf8_lossy(cstr.to_bytes()).into(); + let s = String::from_utf8_lossy(cstr.to_bytes()).into_owned(); unsafe { libc::free(ptr as *mut c_void); }