You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the past we agreed to get rid of these unsafe functions and replace them with static methods, but they've come back on strings and the previous methods are marked as deprecated. AFAIK, this did not go through an RFC, and is inconsistent with the design used elsewhere in the standard library based on the strong consensus in the previous discussions on the mailing list and issue tracker. For example, from_raw_parts is a method on Vec and was a method on String but has been deprecated.
Static methods play very well with Rust's import system, because it allows accessing all of the methods via the scope. It's already marked unsafe, and going out of the way to make unsafe code painful just makes the language lose appeal as a systems language.
The parameters also shifted around in from_parts relative to from_raw_parts on Vec and String, so even that part of the design is inconsistent with Vec<T>.