Skip to content

Commit 9ac2200

Browse files
committed
Following the discussion here: https://users.rust-lang.org/t/c-char-to-str-or-string/9417/9 changed to use to_str -> to_owned
1 parent 103681e commit 9ac2200

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/device/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub fn info_string(verbose: bool) -> String {
7676
let err_val = af_info_string(&mut tmp, verbose);
7777
HANDLE_ERROR(AfError::from(err_val));
7878

79-
let result = CString::from_raw(tmp).into_string().unwrap();
79+
let result = (*CString::from_raw(tmp)).to_str().unwrap().to_owned();
8080

8181
let err_val = af_free_host(tmp as *mut c_void);
8282
HANDLE_ERROR(AfError::from(err_val));

0 commit comments

Comments
 (0)