Commit 36d6103
authored
Rollup merge of rust-lang#65731 - fusion-engineering-forks:set-extension, r=dtolnay
Prevent unnecessary allocation in PathBuf::set_extension.
It was allocating a new `OsString` that was immediately dropped after using it with `set_file_name`. Now it directly changes the extension in the original buffer, without touching the rest of the file name or allocating a temporary string.1 file changed
+15
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1363 | 1363 | | |
1364 | 1364 | | |
1365 | 1365 | | |
1366 | | - | |
1367 | | - | |
1368 | | - | |
1369 | | - | |
1370 | | - | |
1371 | | - | |
1372 | | - | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
1373 | 1369 | | |
1374 | 1370 | | |
1375 | | - | |
1376 | | - | |
1377 | | - | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
1378 | 1383 | | |
1379 | | - | |
1380 | 1384 | | |
1381 | 1385 | | |
1382 | 1386 | | |
| |||
0 commit comments