RFC: get panics out of std::ffi::CString#840
Conversation
|
Alternative: Add a |
|
@kennytm I have added a paragraph on why simply adding functions is worse than changing the "shortest name" API. In case of division, a zero divisor arguably is a programmer error. A restriction on NULs in a string, on the other hand, is arbitrary for the value domain in general (a Unicode text with NUL characters is valid). There are also performance concerns regarding the implementation of division. |
|
That said, a migration path is probably needed whereby the |
|
Thanks so much for throwing this together! I'm increasingly in favor of this approach for C strings. cc @wycats @nikomatsakis @brson @huonw @pcwalton I know CString is somewhat common in Servo, do you all have a preference here? |
|
Seems fine to me. |
|
@aturon +1 from me. |
|
After discussion here and on discuss, we've decided to move forward with this long-requested change. Thanks again, @mzabaluev! We'll try to land this ahead of alpha2 if possible. |
Bring
CStringin line with other library functions on the failure mode conventions.There should be no panic lurking.
Rendered