-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add basename and dirname aliases #102869
Add basename and dirname aliases #102869
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
library/std/src/fs.rs
Outdated
@@ -1670,6 +1670,7 @@ impl DirEntry { | |||
/// } | |||
/// ``` | |||
#[must_use] | |||
#[doc(alias = "basename")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per the doc alias policy:
There must be an obvious single target for the alias that is an exact analogue of the aliased name. We will not add the same alias to multiple declarations. (const and non-const versions of the same function are fine.) We will also not add an alias for a function that's only somewhat similar or related.
I think, of the two, the operation on paths is the one that makes more sense to have this alias.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, pushed to remove the alias for DirEntry
.
@bors r+ rollup |
…iaskrgr Rollup of 11 pull requests Successful merges: - rust-lang#100387 (Check uniqueness of impl items by trait item when applicable.) - rust-lang#101727 (Stabilize map_first_last) - rust-lang#101774 (Warn about safety of `fetch_update`) - rust-lang#102227 (fs::get_path solarish version.) - rust-lang#102445 (Add `is_empty()` method to `core::ffi::CStr`.) - rust-lang#102612 (Migrate `codegen_ssa` to diagnostics structs - [Part 1]) - rust-lang#102685 (Interpret EH actions properly) - rust-lang#102869 (Add basename and dirname aliases) - rust-lang#102889 (rustc_hir: Less error-prone methods for accessing `PartialRes` resolution) - rust-lang#102893 (Fix ICE rust-lang#102878) - rust-lang#102912 (:arrow_up: rust-analyzer) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Add basename and dirname aliases Users might be used to the POSIX names of these functions. In fact, here's a [blog post][1] about this very thing. [1]: https://boinkor.net/2019/07/basename-and-dirname-in-rust/
…iaskrgr Rollup of 11 pull requests Successful merges: - rust-lang#100387 (Check uniqueness of impl items by trait item when applicable.) - rust-lang#101727 (Stabilize map_first_last) - rust-lang#101774 (Warn about safety of `fetch_update`) - rust-lang#102227 (fs::get_path solarish version.) - rust-lang#102445 (Add `is_empty()` method to `core::ffi::CStr`.) - rust-lang#102612 (Migrate `codegen_ssa` to diagnostics structs - [Part 1]) - rust-lang#102685 (Interpret EH actions properly) - rust-lang#102869 (Add basename and dirname aliases) - rust-lang#102889 (rustc_hir: Less error-prone methods for accessing `PartialRes` resolution) - rust-lang#102893 (Fix ICE rust-lang#102878) - rust-lang#102912 (:arrow_up: rust-analyzer) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Users might be used to the POSIX names of these functions. In fact, here's a blog post about this very thing.