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
Rollup merge of rust-lang#136099 - Kijewski:pr-rc-str-default, r=ibraheemdev
Optimize `Rc::<str>::default()` implementation
This PR lets `impl Default for Rc<str>` re-use the implementation for `Rc::<[u8]>::default()`. The previous version only calculted the memory layout at runtime, even though it should be known at compile time, resulting in an additional function call.
The same optimization is done for `Rc<CStr>`.
Generated byte code: <https://godbolt.org/z/dfq73jsoP>.
Resolves <rust-lang#135784>.
Cc `@Billy-Sheppard.`
0 commit comments