@@ -76,6 +76,7 @@ public protocol Path: Hashable, Codable, CustomStringConvertible {
76
76
var components : [ String ] { get }
77
77
}
78
78
79
+ /// Default implementations of some protocol stubs.
79
80
extension Path {
80
81
public var pathString : String {
81
82
if filepath. string. isEmpty {
@@ -145,7 +146,10 @@ extension Path {
145
146
}
146
147
return components
147
148
}
149
+ }
148
150
151
+ /// Default implementation of `CustomStringConvertible`.
152
+ extension Path {
149
153
public var description : String {
150
154
return pathString
151
155
}
@@ -156,6 +160,7 @@ extension Path {
156
160
}
157
161
}
158
162
163
+ /// Default implementation of `Codable`.
159
164
extension Path {
160
165
public func encode( to encoder: Encoder ) throws {
161
166
var container = encoder. singleValueContainer ( )
@@ -265,9 +270,7 @@ public struct AbsolutePath: Path {
265
270
return AbsolutePath ( filepath)
266
271
}
267
272
268
- /// Root directory (whose string representation is just a path separator).
269
- ///
270
- /// FIXME: root is not a static value, we'd better remove this property.
273
+ /// The root directory. It is always `/` on UNIX, but may vary on Windows.
271
274
@available ( * , deprecated, message: " root is not a static value, use the instance property instead " )
272
275
public static var root : AbsolutePath {
273
276
if let rootPath = localFileSystem. currentWorkingDirectory? . root {
0 commit comments