diff options
| author | Tshepang Mbambo <tshepang@gmail.com> | 2023-06-23 04:47:30 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-23 04:47:30 +0200 |
| commit | 6f61f6ba11a1917f3bf7b1bd8054c12bd4e7b6ec (patch) | |
| tree | 74eae439e2aedfb3e7b59ca3750b37d78cc9d8f0 /library/std | |
| parent | 04075b32021932e3e8f6ab55d519b3b3494b6ef9 (diff) | |
| download | rust-6f61f6ba11a1917f3bf7b1bd8054c12bd4e7b6ec.tar.gz rust-6f61f6ba11a1917f3bf7b1bd8054c12bd4e7b6ec.zip | |
DirEntry::file_name: improve explanation
Diffstat (limited to 'library/std')
| -rw-r--r-- | library/std/src/fs.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/library/std/src/fs.rs b/library/std/src/fs.rs index 89dfdfafdb1..c2d82169dc3 100644 --- a/library/std/src/fs.rs +++ b/library/std/src/fs.rs @@ -1755,8 +1755,14 @@ impl DirEntry { self.0.file_type().map(FileType) } - /// Returns the bare file name of this directory entry without any other - /// leading path component. + /// Returns the file name of this directory entry without any + /// leading path component(s). + /// + /// As an example, + /// the output of the function will result in "foo" for all the following paths: + /// - "./foo" + /// - "/the/foo" + /// - "../../foo" /// /// # Examples /// |
