@@ -76,6 +76,7 @@ public protocol Path: Hashable, Codable, CustomStringConvertible {
7676 var components : [ String ] { get }
7777}
7878
79+ /// Default implementations of some protocol stubs.
7980extension Path {
8081 public var pathString : String {
8182 if filepath. string. isEmpty {
@@ -145,7 +146,10 @@ extension Path {
145146 }
146147 return components
147148 }
149+ }
148150
151+ /// Default implementation of `CustomStringConvertible`.
152+ extension Path {
149153 public var description : String {
150154 return pathString
151155 }
@@ -156,6 +160,7 @@ extension Path {
156160 }
157161}
158162
163+ /// Default implementation of `Codable`.
159164extension Path {
160165 public func encode( to encoder: Encoder ) throws {
161166 var container = encoder. singleValueContainer ( )
@@ -265,9 +270,7 @@ public struct AbsolutePath: Path {
265270 return AbsolutePath ( filepath)
266271 }
267272
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.
271274 @available ( * , deprecated, message: " root is not a static value, use the instance property instead " )
272275 public static var root : AbsolutePath {
273276 if let rootPath = localFileSystem. currentWorkingDirectory? . root {
0 commit comments