Skip to content

Commit 61519b8

Browse files
committed
Add basename and dirname aliases
1 parent 1a7c203 commit 61519b8

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

library/std/src/fs.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1670,6 +1670,7 @@ impl DirEntry {
16701670
/// }
16711671
/// ```
16721672
#[must_use]
1673+
#[doc(alias = "basename")]
16731674
#[stable(feature = "dir_entry_ext", since = "1.1.0")]
16741675
pub fn file_name(&self) -> OsString {
16751676
self.0.file_name()

library/std/src/path.rs

+2
Original file line numberDiff line numberDiff line change
@@ -2158,6 +2158,7 @@ impl Path {
21582158
/// assert_eq!(grand_parent.parent(), None);
21592159
/// ```
21602160
#[stable(feature = "rust1", since = "1.0.0")]
2161+
#[doc(alias = "dirname")]
21612162
#[must_use]
21622163
pub fn parent(&self) -> Option<&Path> {
21632164
let mut comps = self.components();
@@ -2225,6 +2226,7 @@ impl Path {
22252226
/// assert_eq!(None, Path::new("/").file_name());
22262227
/// ```
22272228
#[stable(feature = "rust1", since = "1.0.0")]
2229+
#[doc(alias = "basename")]
22282230
#[must_use]
22292231
pub fn file_name(&self) -> Option<&OsStr> {
22302232
self.components().next_back().and_then(|p| match p {

0 commit comments

Comments
 (0)