-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Ubdate to Swift 5.0 #1066
base: master
Are you sure you want to change the base?
Ubdate to Swift 5.0 #1066
Conversation
@@ -272,7 +272,7 @@ public extension Mapper where N: ImmutableMappable { | |||
#if swift(>=4.1) | |||
return try JSONArray.compactMap(mapOrFail) | |||
#else | |||
return try JSONArray.flatMap(mapOrFail) | |||
return try JSONArray.compactMap(mapOrFail) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please just remove else
statement if it is necessary because now if
and else
blocks has same actions.
@@ -134,7 +134,7 @@ public final class Map { | |||
#if swift(>=4.1) | |||
return v.compactMap{ Float($0) } as? T | |||
#else | |||
return v.flatMap{ Float($0) } as? T | |||
return v.compactMap{ Float($0) } as? T |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above.
Please just remove else
statement if it is necessary because now if
and else
blocks has same actions.
@@ -165,7 +165,7 @@ public final class Mapper<N: BaseMappable> { | |||
#if swift(>=4.1) | |||
let result = JSONArray.compactMap(map) | |||
#else | |||
let result = JSONArray.flatMap(map) | |||
let result = JSONArray.compactMap(map) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above.
Please just remove else
statement if it is necessary because now if
and else
blocks has same actions.
@@ -433,7 +433,7 @@ extension Mapper where N: Hashable { | |||
#if swift(>=4.1) | |||
return Set(JSONArray.compactMap(map)) | |||
#else | |||
return Set(JSONArray.flatMap(map)) | |||
return Set(JSONArray.compactMap(map)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above.
Please just remove else
statement if it is necessary because now if
and else
blocks has same actions.
I updated the code to Swift 5.0