mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-17 01:13:11 +00:00
Use String::from_utf8_lossy in CStr demo
This commit is contained in:
parent
b4151a41a0
commit
79e0543060
@ -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…
Reference in New Issue
Block a user