Documentation for CStr is not that of CString#84000
Documentation for CStr is not that of CString#84000eggyal wants to merge 1 commit intorust-lang:masterfrom
CStr is not that of CString#84000Conversation
|
r? @m-ou-se (rust-highfive has picked a reviewer for you, use r? to override) |
61aa43d to
72cac1c
Compare
|
@eggyal , have you had time to address the most recent comments? |
|
Erroneous push closed PR accidentally. @rustbot label -S-waiting-on-author +S-waiting-on-review |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
d16d8ca to
053e0c7
Compare
This comment has been minimized.
This comment has been minimized.
|
Aaagh, sorry, I'm making a right hash of git today. |
m-ou-se
left a comment
There was a problem hiding this comment.
I don't think this change in its current form is an improvement. The original example shows the subtle mistake of using CString::new and .as_ptr() in the same expression, which is an easy mistake to make. The new example shows a more contrived snippet, which doesn't show as clearly how easy it is to make this mistake.
In addition, the changed documentation continues to explain a fix that doesn't just keep the right variable alive longer, but uses a completely different method of using a [u8; _] called bytes which the first example doesn't have, making it harder to focus on the lifetime problem itself.
|
@eggyal Ping from triage, any updates on this? |
|
@eggyal Ping from triage: I'm closing this as inactive because it hasn't moved for a month. Please feel free to reopen when you're ready to continue. |
Fixes #83999