Skip to content

Commit

Permalink
Fix Xcode 8.1 implicit Any conversion warning (lyft#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith Smiley authored Nov 10, 2016
1 parent 1019e63 commit 3892335
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

## Bug Fixes

- None
- Fix Xcode 8.1 `Any` -> `Any?` warning
[Keith Smiley](https://github.com/keith)
[#87](https://github.com/lyft/mapper/pull/87)

# 5.0.0

Expand Down
2 changes: 1 addition & 1 deletion Sources/Mapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ public struct Mapper {
/// - returns: The value of type T for the given field, if the transformation function doesn't throw
/// otherwise nil
public func optionalFrom<T>(_ field: String, transformation: (Any) throws -> T?) -> T? {
return (try? transformation(try? self.JSONFromField(field))).flatMap { $0 }
return (try? transformation(try self.JSONFromField(field))).flatMap { $0 }
}

// MARK: - Private
Expand Down

0 comments on commit 3892335

Please sign in to comment.