[skip ci]
This commit is contained in:
Max Howell
2019-01-28 16:05:39 +00:00
parent 2394cc1c85
commit ee1f46954c
2 changed files with 3 additions and 3 deletions

View File

@@ -36,7 +36,7 @@ public struct Path: Equatable, Hashable, Comparable {
self.string = string
}
/// Returns `nil` unless fed an absolute path
/// Returns `nil` unless fed an absolute path.
public init?(_ description: String) {
guard description.starts(with: "/") || description.starts(with: "~/") else { return nil }
self.init(string: (description as NSString).standardizingPath)
@@ -91,7 +91,7 @@ public struct Path: Equatable, Hashable, Comparable {
- Parameter pathComponent: The string to join with this path.
- Returns: A new joined path.
- SeeAlso: `Path./(_:, _:)`
- SeeAlso: `Path./(_:_:)`
*/
public func join<S>(_ pathComponent: S) -> Path where S: StringProtocol {
//TODO standardizingPath does more than we want really (eg tilde expansion)