From 6f61f6ba11a1917f3bf7b1bd8054c12bd4e7b6ec Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Fri, 23 Jun 2023 04:47:30 +0200 Subject: [PATCH] DirEntry::file_name: improve explanation --- library/std/src/fs.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/library/std/src/fs.rs b/library/std/src/fs.rs index 89dfdfafdb179..c2d82169dc30e 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 ///