Show More
@@ -142,22 +142,24 b' impl HgPath {' | |||||
142 | #[cfg(windows)] |
|
142 | #[cfg(windows)] | |
143 | /// Copied from the Python stdlib's `os.path.splitdrive` implementation. |
|
143 | /// Copied from the Python stdlib's `os.path.splitdrive` implementation. | |
144 | /// |
|
144 | /// | |
145 |
/// Split a pathname into drive/UNC sharepoint and relative path |
|
145 | /// Split a pathname into drive/UNC sharepoint and relative path | |
146 |
/// Returns a 2-tuple (drive_or_unc, path); either part may |
|
146 | /// specifiers. Returns a 2-tuple (drive_or_unc, path); either part may | |
|
147 | /// be empty. | |||
147 | /// |
|
148 | /// | |
148 | /// If you assign |
|
149 | /// If you assign | |
149 | /// result = split_drive(p) |
|
150 | /// result = split_drive(p) | |
150 | /// It is always true that: |
|
151 | /// It is always true that: | |
151 | /// result[0] + result[1] == p |
|
152 | /// result[0] + result[1] == p | |
152 | /// |
|
153 | /// | |
153 |
/// If the path contained a drive letter, drive_or_unc will contain |
|
154 | /// If the path contained a drive letter, drive_or_unc will contain | |
154 | /// up to and including the colon. |
|
155 | /// everything up to and including the colon. | |
155 | /// e.g. split_drive("c:/dir") returns ("c:", "/dir") |
|
156 | /// e.g. split_drive("c:/dir") returns ("c:", "/dir") | |
156 | /// |
|
157 | /// | |
157 |
/// If the path contained a UNC path, the drive_or_unc will contain the |
|
158 | /// If the path contained a UNC path, the drive_or_unc will contain the | |
158 |
/// name and share up to but not including the fourth directory |
|
159 | /// host name and share up to but not including the fourth directory | |
159 | /// character. |
|
160 | /// separator character. | |
160 |
/// e.g. split_drive("//host/computer/dir") returns ("//host/computer", |
|
161 | /// e.g. split_drive("//host/computer/dir") returns ("//host/computer", | |
|
162 | /// "/dir") | |||
161 | /// |
|
163 | /// | |
162 | /// Paths cannot contain both a drive letter and a UNC path. |
|
164 | /// Paths cannot contain both a drive letter and a UNC path. | |
163 | pub fn split_drive<'a>(&self) -> (&HgPath, &HgPath) { |
|
165 | pub fn split_drive<'a>(&self) -> (&HgPath, &HgPath) { |
General Comments 0
You need to be logged in to leave comments.
Login now