This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit da1ca5d
authored
Rollup merge of rust-lang#104298 - tbu-:pr_set_extension_caveats, r=m-ou-se
Add notes and examples about non-intuitive `PathBuf::set_extension` behavior
Basically, passing the empty string will actually remove the extension instead of setting it to the empty string. This might change what is considered to be an extension. Additionally, passing an extension that contains dots will make the path only consider the last part of it to be the new extension.1 file changed
+30
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1414 | 1414 | | |
1415 | 1415 | | |
1416 | 1416 | | |
1417 | | - | |
| 1417 | + | |
| 1418 | + | |
1418 | 1419 | | |
1419 | 1420 | | |
1420 | 1421 | | |
1421 | 1422 | | |
1422 | 1423 | | |
1423 | 1424 | | |
1424 | 1425 | | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
1425 | 1440 | | |
1426 | 1441 | | |
1427 | 1442 | | |
| |||
1435 | 1450 | | |
1436 | 1451 | | |
1437 | 1452 | | |
1438 | | - | |
1439 | | - | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
1440 | 1467 | | |
1441 | 1468 | | |
1442 | 1469 | | |
| |||
0 commit comments