Unnamed repository; edit this file 'description' to name the repository.
Auto merge of #113106 - marcospb19:improve-path-with-extension-function, r=thomcc
std: remove an allocation in `Path::with_extension` `Path::with_extension` used to reallocate (and copy) paths twice per call, now it does it once, by checking the size of the previous and new extensions it's possible to call `PathBuf::with_capacity` and pass the exact capacity required. This also reduces the memory consumption of the path returned from `Path::with_extension` by using exact capacity instead of using amortized exponential growth.
bors 2023-07-21
parent 675e617 · parent e1492b1 · commit ddb7a1a
0 files changed, 0 insertions, 0 deletions