diff --git a/library/core/src/ffi/c_str.rs b/library/core/src/ffi/c_str.rs index ee9baf811e29..1deb41593d97 100644 --- a/library/core/src/ffi/c_str.rs +++ b/library/core/src/ffi/c_str.rs @@ -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())) /// } /// } ///