Skip to content

Commit

Permalink
Merge pull request #46 from futuredapp/housekeep/any-encode-improvement
Browse files Browse the repository at this point in the history
Simplify any encodable initializer
  • Loading branch information
mkj-is authored Jan 25, 2020
2 parents 8153c0d + 41b54de commit 3c7f328
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Sources/FTAPIKit/AnyEncodable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ struct AnyEncodable: Encodable {
private let anyEncode: (Encoder) throws -> Void

init(_ encodable: Encodable) {
anyEncode = { encoder in
try encodable.encode(to: encoder)
}
anyEncode = encodable.encode
}

func encode(to encoder: Encoder) throws {
Expand Down

0 comments on commit 3c7f328

Please sign in to comment.