Skip to content

[swift5] fix warning in Swift 5.2 #5900

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
Apr 13, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ protocol JSONEncodable {
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} convenience init(response: HTTPURLResponse, body: T?) {
let rawHeader = response.allHeaderFields
var header = [String:String]()
for case let (key, value) as (String, String) in rawHeader {
header[key] = value
for (key, value) in rawHeader {
if let key = key as? String, let value = value as? String {
header[key] = value
}
}
self.init(statusCode: response.statusCode, header: header, body: body)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.3.0-SNAPSHOT
4.3.1-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
Base,
en,
);
mainGroup = 5FBA6AE5F64CD737F88B4565;
Expand Down Expand Up @@ -569,7 +568,7 @@
3B2C02AFB91CB5C82766ED5C /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = "";
defaultConfigurationName = Debug;
};
ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = {
isa = XCConfigurationList;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@
</MacroExpansion>
<CommandLineArguments>
</CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
<CodeCoverageTargets>
</CodeCoverageTargets>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -67,8 +63,6 @@
</MacroExpansion>
<CommandLineArguments>
</CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ open class Response<T> {
public convenience init(response: HTTPURLResponse, body: T?) {
let rawHeader = response.allHeaderFields
var header = [String: String]()
for case let (key, value) as (String, String) in rawHeader {
header[key] = value
for (key, value) in rawHeader {
if let key = key as? String, let value = value as? String {
header[key] = value
}
}
self.init(statusCode: response.statusCode, header: header, body: body)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.3.0-SNAPSHOT
4.3.1-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
Base,
en,
);
mainGroup = 5FBA6AE5F64CD737F88B4565;
Expand Down Expand Up @@ -521,7 +520,7 @@
3B2C02AFB91CB5C82766ED5C /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = "";
defaultConfigurationName = Debug;
};
ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = {
isa = XCConfigurationList;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@
</MacroExpansion>
<CommandLineArguments>
</CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
<CodeCoverageTargets>
</CodeCoverageTargets>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -67,8 +63,6 @@
</MacroExpansion>
<CommandLineArguments>
</CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ open class Response<T> {
public convenience init(response: HTTPURLResponse, body: T?) {
let rawHeader = response.allHeaderFields
var header = [String: String]()
for case let (key, value) as (String, String) in rawHeader {
header[key] = value
for (key, value) in rawHeader {
if let key = key as? String, let value = value as? String {
header[key] = value
}
}
self.init(statusCode: response.statusCode, header: header, body: body)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.3.0-SNAPSHOT
4.3.1-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
Base,
en,
);
mainGroup = 5FBA6AE5F64CD737F88B4565;
Expand Down Expand Up @@ -521,7 +520,7 @@
3B2C02AFB91CB5C82766ED5C /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = "";
defaultConfigurationName = Debug;
};
ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = {
isa = XCConfigurationList;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@
</MacroExpansion>
<CommandLineArguments>
</CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
<CodeCoverageTargets>
</CodeCoverageTargets>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -67,8 +63,6 @@
</MacroExpansion>
<CommandLineArguments>
</CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ open class Response<T> {
public convenience init(response: HTTPURLResponse, body: T?) {
let rawHeader = response.allHeaderFields
var header = [String: String]()
for case let (key, value) as (String, String) in rawHeader {
header[key] = value
for (key, value) in rawHeader {
if let key = key as? String, let value = value as? String {
header[key] = value
}
}
self.init(statusCode: response.statusCode, header: header, body: body)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.3.0-SNAPSHOT
4.3.1-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
Base,
en,
);
mainGroup = 5FBA6AE5F64CD737F88B4565;
Expand Down Expand Up @@ -521,7 +520,7 @@
3B2C02AFB91CB5C82766ED5C /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = "";
defaultConfigurationName = Debug;
};
ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = {
isa = XCConfigurationList;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@
</MacroExpansion>
<CommandLineArguments>
</CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
<CodeCoverageTargets>
</CodeCoverageTargets>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -67,8 +63,6 @@
</MacroExpansion>
<CommandLineArguments>
</CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ internal class Response<T> {
internal convenience init(response: HTTPURLResponse, body: T?) {
let rawHeader = response.allHeaderFields
var header = [String: String]()
for case let (key, value) as (String, String) in rawHeader {
header[key] = value
for (key, value) in rawHeader {
if let key = key as? String, let value = value as? String {
header[key] = value
}
}
self.init(statusCode: response.statusCode, header: header, body: body)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.3.0-SNAPSHOT
4.3.1-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
Base,
en,
);
mainGroup = 5FBA6AE5F64CD737F88B4565;
Expand Down Expand Up @@ -521,7 +520,7 @@
3B2C02AFB91CB5C82766ED5C /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = "";
defaultConfigurationName = Debug;
};
ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = {
isa = XCConfigurationList;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@
</MacroExpansion>
<CommandLineArguments>
</CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
<CodeCoverageTargets>
</CodeCoverageTargets>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -67,8 +63,6 @@
</MacroExpansion>
<CommandLineArguments>
</CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ open class Response<T> {
public convenience init(response: HTTPURLResponse, body: T?) {
let rawHeader = response.allHeaderFields
var header = [String: String]()
for case let (key, value) as (String, String) in rawHeader {
header[key] = value
for (key, value) in rawHeader {
if let key = key as? String, let value = value as? String {
header[key] = value
}
}
self.init(statusCode: response.statusCode, header: header, body: body)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.3.0-SNAPSHOT
4.3.1-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
Base,
en,
);
mainGroup = 5FBA6AE5F64CD737F88B4565;
Expand Down Expand Up @@ -569,7 +568,7 @@
3B2C02AFB91CB5C82766ED5C /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = "";
defaultConfigurationName = Debug;
};
ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = {
isa = XCConfigurationList;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@
</MacroExpansion>
<CommandLineArguments>
</CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
<CodeCoverageTargets>
</CodeCoverageTargets>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -67,8 +63,6 @@
</MacroExpansion>
<CommandLineArguments>
</CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ open class Response<T> {
public convenience init(response: HTTPURLResponse, body: T?) {
let rawHeader = response.allHeaderFields
var header = [String: String]()
for case let (key, value) as (String, String) in rawHeader {
header[key] = value
for (key, value) in rawHeader {
if let key = key as? String, let value = value as? String {
header[key] = value
}
}
self.init(statusCode: response.statusCode, header: header, body: body)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.3.0-SNAPSHOT
4.3.1-SNAPSHOT
Loading