Skip to content

Commit 362c3af

Browse files
authored
Merge pull request swiftlang#2300 from ikesyo/address-warnings
[gardening] Address some warnings
2 parents be2827c + cd6172f commit 362c3af

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

Diff for: Foundation/HTTPCookieStorage.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ open class HTTPCookieStorage: NSObject {
8989
private func loadPersistedCookies() {
9090
guard let cookieFilePath = self.cookieFilePath, let cookiesData = try? Data(contentsOf: URL(fileURLWithPath: cookieFilePath)) else { return }
9191
guard let cookies = try? PropertyListSerialization.propertyList(from: cookiesData, format: nil) else { return }
92-
var cookies0 = cookies as? [String: [String: Any]] ?? [:]
92+
let cookies0 = cookies as? [String: [String: Any]] ?? [:]
9393
self.syncQ.sync {
9494
for key in cookies0.keys {
9595
if let cookie = createCookie(cookies0[key]!) {

Diff for: Foundation/JSONEncoder.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,7 @@ open class JSONDecoder {
10781078
let leadingUnderscoreRange = stringKey.startIndex..<firstNonUnderscore
10791079
let trailingUnderscoreRange = stringKey.index(after: lastNonUnderscore)..<stringKey.endIndex
10801080

1081-
var components = stringKey[keyRange].split(separator: "_")
1081+
let components = stringKey[keyRange].split(separator: "_")
10821082
let joinedString : String
10831083
if components.count == 1 {
10841084
// No underscores in key, leave the word as is - maybe already camel cased

Diff for: Foundation/NSData.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ open class NSData : NSObject, NSCopying, NSMutableCopying, NSSecureCoding {
425425
let permissions = (try? fm._permissionsOfItem(atPath: path)) ?? 0o600
426426

427427
if writeOptionsMask.contains(.atomic) {
428-
var (newFD, auxFilePath) = try _NSCreateTemporaryFile(path)
428+
let (newFD, auxFilePath) = try _NSCreateTemporaryFile(path)
429429
let fh = FileHandle(fileDescriptor: newFD, closeOnDealloc: true)
430430
do {
431431
try doWrite(fh)

Diff for: TestFoundation/FTPServer.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ class _FTPServer {
202202
try respondWithRawData(with: "150 Ok to send data.\r\n")
203203
// Read data from the data socket and respond with completion header after the transfer
204204
do {
205-
let readData = try readDataOnDataSocket()
205+
_ = try readDataOnDataSocket()
206206
try respondWithRawData(with: "226 Transfer complete.\r\n")
207207
} catch {
208208
NSLog("Transfer failed.")

0 commit comments

Comments
 (0)