]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #104298 - tbu-:pr_set_extension_caveats, r=m-ou-se
authorMichael Goulet <michael@errs.io>
Mon, 2 Jan 2023 23:39:16 +0000 (15:39 -0800)
committerGitHub <noreply@github.com>
Mon, 2 Jan 2023 23:39:16 +0000 (15:39 -0800)
commitda1ca5df6e0ce759d409ce853d836cb00542c44f
treeffd2f49f671998264f89b3fc4307883bea885ae4
parent722bc0c8ee92b391ddf6bd77f43fae1432d9234f
parent40916ef88f7809c5e8956a3917e00681ad25c30b
Rollup merge of #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.
library/std/src/path.rs