Path::with_extension: show that it adds an extension where one did no…#141477
Path::with_extension: show that it adds an extension where one did no…#141477bors merged 2 commits intorust-lang:masterfrom
Conversation
|
r? @ChrisDenton rustbot has assigned @ChrisDenton. Use |
|
I think it would also make sense to show what the output of also, you say there's already a "similar" example, but the .tar.gz example is there to show the case of multiple extensions, while the .rs example is there to show the base case. if any example is redundant, i think it would be the .tar.xz example, but we could also just add an example without removing anything. (disclaimer: not part of t-libs) |
|
I like adding an example for the no extension case but I would agree that replacing the existing example isn't the way to do it. Having three examples seems fine (maybe with a brief comment pointing out what it's showing). Personally I'd be minded to split this into two separate code blocks as the multiple extension case is a little more involved than the simpler cases. But I don't feel strongly about that. |
|
added commit to reduce visual noise... happy to remove if relying on type coercion is not ideal |
|
Thanks! @bors r+ rollup |
Path::with_extension: show that it adds an extension where one did no… …t exist I think the times I encountered this, I had to check first if files without extensions were added, since all examples only had files with existing extensions. Also, this replaced example already has a similar example below.
Path::with_extension: show that it adds an extension where one did no… …t exist I think the times I encountered this, I had to check first if files without extensions were added, since all examples only had files with existing extensions. Also, this replaced example already has a similar example below.
Rollup of 7 pull requests Successful merges: - #125087 (Optimize `Seek::stream_len` impl for `File`) - #133823 (Use `cfg_attr_trace` in AST with a placeholder attribute for accurate suggestion) - #138285 (Stabilize `repr128`) - #139994 (add `CStr::display`) - #141477 (Path::with_extension: show that it adds an extension where one did no…) - #141533 (clean up old rintf leftovers) - #141693 (Subtree update of `rust-analyzer`) r? `@ghost` `@rustbot` modify labels: rollup
Path::with_extension: show that it adds an extension where one did no… …t exist I think the times I encountered this, I had to check first if files without extensions were added, since all examples only had files with existing extensions. Also, this replaced example already has a similar example below.
Rollup of 8 pull requests Successful merges: - #125087 (Optimize `Seek::stream_len` impl for `File`) - #138285 (Stabilize `repr128`) - #139994 (add `CStr::display`) - #141477 (Path::with_extension: show that it adds an extension where one did no…) - #141533 (clean up old rintf leftovers) - #141690 (Add `rustc_diagnostic_item` to `sys::Mutex` methods) - #141693 (Subtree update of `rust-analyzer`) - #141702 (Add eholk to compiler reviewer rotation) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 16 pull requests Successful merges: - #136429 (GCI: At their def site, actually wfcheck the where-clause & always eval free lifetime-generic constants) - #138139 (Emit warning while outputs is not exe and prints linkage info) - #141104 (Test(fs): Fix `test_eq_windows_file_type` for Windows 7) - #141477 (Path::with_extension: show that it adds an extension where one did no…) - #141533 (clean up old rintf leftovers) - #141612 (Call out possibility of invariant result in variance markers) - #141638 (Use `builtin_index` instead of hand-rolling it) - #141643 (ci: verify that codebuild jobs use ghcr.io) - #141675 (Reorder `ast::ItemKind::{Struct,Enum,Union}` fields.) - #141680 (replace TraitRef link memory.md) - #141682 (interpret/allocation: Fixup type for `alloc_bytes`) - #141683 (Handle ed2021 precise capturing of unsafe binder) - #141684 (rustbook: Bump versions of `onig` and `onig_sys`) - #141687 (core: unstably expose atomic_compare_exchange so stdarch can use it) - #141690 (Add `rustc_diagnostic_item` to `sys::Mutex` methods) - #141702 (Add eholk to compiler reviewer rotation) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #141477 - tshepang:patch-1, r=ChrisDenton Path::with_extension: show that it adds an extension where one did no… …t exist I think the times I encountered this, I had to check first if files without extensions were added, since all examples only had files with existing extensions. Also, this replaced example already has a similar example below.
Path::with_extension: show that it adds an extension where one did no… …t exist I think the times I encountered this, I had to check first if files without extensions were added, since all examples only had files with existing extensions. Also, this replaced example already has a similar example below.
Rollup of 16 pull requests Successful merges: - rust-lang/rust#136429 (GCI: At their def site, actually wfcheck the where-clause & always eval free lifetime-generic constants) - rust-lang/rust#138139 (Emit warning while outputs is not exe and prints linkage info) - rust-lang/rust#141104 (Test(fs): Fix `test_eq_windows_file_type` for Windows 7) - rust-lang/rust#141477 (Path::with_extension: show that it adds an extension where one did no…) - rust-lang/rust#141533 (clean up old rintf leftovers) - rust-lang/rust#141612 (Call out possibility of invariant result in variance markers) - rust-lang/rust#141638 (Use `builtin_index` instead of hand-rolling it) - rust-lang/rust#141643 (ci: verify that codebuild jobs use ghcr.io) - rust-lang/rust#141675 (Reorder `ast::ItemKind::{Struct,Enum,Union}` fields.) - rust-lang/rust#141680 (replace TraitRef link memory.md) - rust-lang/rust#141682 (interpret/allocation: Fixup type for `alloc_bytes`) - rust-lang/rust#141683 (Handle ed2021 precise capturing of unsafe binder) - rust-lang/rust#141684 (rustbook: Bump versions of `onig` and `onig_sys`) - rust-lang/rust#141687 (core: unstably expose atomic_compare_exchange so stdarch can use it) - rust-lang/rust#141690 (Add `rustc_diagnostic_item` to `sys::Mutex` methods) - rust-lang/rust#141702 (Add eholk to compiler reviewer rotation) r? `@ghost` `@rustbot` modify labels: rollup
…t exist
I think the times I encountered this, I had to check first if files without extensions were added, since all examples only had files with existing extensions.
Also, this replaced example already has a similar example below.