Skip to content

[gardening] Address some warnings #2300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Foundation/HTTPCookieStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ open class HTTPCookieStorage: NSObject {
private func loadPersistedCookies() {
guard let cookieFilePath = self.cookieFilePath, let cookiesData = try? Data(contentsOf: URL(fileURLWithPath: cookieFilePath)) else { return }
guard let cookies = try? PropertyListSerialization.propertyList(from: cookiesData, format: nil) else { return }
var cookies0 = cookies as? [String: [String: Any]] ?? [:]
let cookies0 = cookies as? [String: [String: Any]] ?? [:]
self.syncQ.sync {
for key in cookies0.keys {
if let cookie = createCookie(cookies0[key]!) {
Expand Down
2 changes: 1 addition & 1 deletion Foundation/JSONEncoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@ open class JSONDecoder {
let leadingUnderscoreRange = stringKey.startIndex..<firstNonUnderscore
let trailingUnderscoreRange = stringKey.index(after: lastNonUnderscore)..<stringKey.endIndex

var components = stringKey[keyRange].split(separator: "_")
let components = stringKey[keyRange].split(separator: "_")
let joinedString : String
if components.count == 1 {
// No underscores in key, leave the word as is - maybe already camel cased
Expand Down
2 changes: 1 addition & 1 deletion Foundation/NSData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ open class NSData : NSObject, NSCopying, NSMutableCopying, NSSecureCoding {
let permissions = (try? fm._permissionsOfItem(atPath: path)) ?? 0o600

if writeOptionsMask.contains(.atomic) {
var (newFD, auxFilePath) = try _NSCreateTemporaryFile(path)
let (newFD, auxFilePath) = try _NSCreateTemporaryFile(path)
let fh = FileHandle(fileDescriptor: newFD, closeOnDealloc: true)
do {
try doWrite(fh)
Expand Down
2 changes: 1 addition & 1 deletion TestFoundation/FTPServer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ class _FTPServer {
try respondWithRawData(with: "150 Ok to send data.\r\n")
// Read data from the data socket and respond with completion header after the transfer
do {
let readData = try readDataOnDataSocket()
_ = try readDataOnDataSocket()
try respondWithRawData(with: "226 Transfer complete.\r\n")
} catch {
NSLog("Transfer failed.")
Expand Down