Use String::from_utf8_lossy in CStr demo

This commit is contained in:
Jubilee Young 2022-07-26 13:26:05 -07:00
parent b4151a41a0
commit 79e0543060

View File

@ -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()))
/// }
/// }
///