Use String::from_utf8_lossy in CStr demo
This commit is contained in:
parent
b4151a41a0
commit
79e0543060
1 changed files with 1 additions and 1 deletions
|
|
@ -66,7 +66,7 @@ use crate::str;
|
|||
///
|
||||
/// fn my_string_safe() -> String {
|
||||
/// unsafe {
|
||||
/// CStr::from_ptr(my_string()).to_string_lossy().into_owned()
|
||||
/// String::from_utf8_lossy(CStr::from_ptr(my_string()))
|
||||
/// }
|
||||
/// }
|
||||
///
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue