Skip to content

Commit 86e4dfc

Browse files
al45taircompnerd
andauthored
Apply suggestions from code review
Co-authored-by: Saleem Abdulrasool <compnerd@compnerd.org>
1 parent 38d7233 commit 86e4dfc

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

Sources/System/FilePath/FilePathParsing.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ extension FilePath {
335335
// Whether we are providing Windows paths
336336
@inline(__always)
337337
internal var _windowsPaths: Bool {
338-
if let forceWindowsPaths = forceWindowsPaths {
338+
if let forceWindowsPaths {
339339
return forceWindowsPaths
340340
}
341341
#if os(Windows)

Sources/System/FilePath/FilePathTemp.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,10 @@ fileprivate func makeLockedDownDirectory(at path: FilePath) throws -> Bool {
5050
return true
5151
}
5252
let err = system_errno
53-
if err == Errno.fileExists.rawValue {
54-
return false
55-
} else {
53+
guard err == Errno.fileExists.rawValue else {
5654
throw Errno(rawValue: err)
5755
}
56+
return false
5857
}
5958
}
6059

@@ -65,7 +64,7 @@ fileprivate func makeLockedDownDirectory(at path: FilePath) throws -> Bool {
6564
/// - Returns: A random string of length `length`.
6665
fileprivate func createRandomString(length: Int) -> String {
6766
return String(
68-
decoding: (0..<length).map{
67+
decoding: (0..<length).map {
6968
_ in base64[Int.random(in: 0..<64)]
7069
},
7170
as: UTF8.self

0 commit comments

Comments
 (0)