-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
CString
in line with other library functions on the failure mode conventions.There should be no panic lurking.
Rendered