Skip to content

Commit 287d51d

Browse files
committed
update std/os/filepath
1 parent fd26eec commit 287d51d

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/std/os-filepath.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,11 @@ fn Clean(path: str): str
3535
```
3636
Returns the shortest path name equivalent to path by purely lexical processing\. It applies the following rules iteratively until no further processing can be done:
3737

38-
```
39-
1. Replace multiple SEPARATOR elements with a single one.
40-
2. Eliminate each . path name element (the current directory).
41-
3. Eliminate each inner .. path name element (the parent directory)
42-
along with the non-.. element that precedes it.
43-
4. Eliminate .. elements that begin a rooted path:
44-
that is, replace "/.." by "/" at the beginning of a path,
45-
assuming SEPARATOR is '/'.
46-
```
38+
1. Replace multiple SEPARATOR elements with a single one\.
39+
2. Eliminate each \. path name element \(the current directory\)\.
40+
3. Eliminate each inner \.\. path name element \(the parent directory\) along with the non\-\.\. element that precedes it\.
41+
4. Eliminate \.\. elements that begin a rooted path: that is, replace "/\.\." by "/" at the beginning of a path, assuming SEPARATOR is '/'\.
42+
4743
The returned path ends in a slash only if it represents a root directory, such as "/" on Unix or \`C:\\\` on Windows\.
4844

4945
Finally, any occurrences of slash are replaced by SEPARATOR\.

0 commit comments

Comments
 (0)