You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/std/os-filepath.md
+5-9Lines changed: 5 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,15 +35,11 @@ fn Clean(path: str): str
35
35
```
36
36
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:
37
37
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
+
47
43
The returned path ends in a slash only if it represents a root directory, such as "/" on Unix or \`C:\\\` on Windows\.
48
44
49
45
Finally, any occurrences of slash are replaced by SEPARATOR\.
0 commit comments