Documentation of `CStr::from_ptr` suggests using `str::from_utf8(slice.to_bytes()).unwrap()` to obtain a `&str` but `CStr` has `CStr::to_str` that does exactly that. |
||
|---|---|---|
| .. | ||
| c_str.rs | ||
| mod.rs | ||
| os_str.rs | ||
Documentation of `CStr::from_ptr` suggests using `str::from_utf8(slice.to_bytes()).unwrap()` to obtain a `&str` but `CStr` has `CStr::to_str` that does exactly that. |
||
|---|---|---|
| .. | ||
| c_str.rs | ||
| mod.rs | ||
| os_str.rs | ||