Skip to content

Commit

Permalink
Updated Swift 04-25 and 05-03 snapshots (#6)
Browse files Browse the repository at this point in the history
* Updated Swift 04-25

* Updating to 05.03 snapshot
  • Loading branch information
kiokumicu authored and antonmes committed May 12, 2016
1 parent 61e395f commit 0afb548
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
swift-DEVELOPMENT-SNAPSHOT-2016-04-12-a
DEVELOPMENT-SNAPSHOT-2016-05-03-a
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ dist: trusty
osx_image: xcode7.3
install:
- eval "$(curl -sL https://raw.githubusercontent.com/Zewo/Zewo/5254525d9da56df29346fd76e99529c22034d61d/Scripts/install-swiftenv.sh)"
script:
- swift build --fetch # clones all dependencies
- rm -rf Packages/*/Tests # deletes dependency's tests until duplicate Package.tests issue can be resolved in SPM. At that point, remove.
script:
- swift build -Xlinker -rpath -Xlinker $(pwd)/.build/debug/
- swift build --configuration release -Xlinker -rpath -Xlinker $(pwd)/.build/release/
- swift test
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import PackageDescription
let package = Package(
name: "Mapper",
dependencies: [
.Package(url: "https://github.com/Zewo/StructuredData.git", majorVersion: 0, minor: 5)
.Package(url: "https://github.com/Zewo/StructuredData.git", majorVersion: 0, minor: 7)
]
)
2 changes: 1 addition & 1 deletion Sources/Initializable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public enum InitializableError: ErrorProtocol {
extension Int: StructuredDataInitializable {
public init(structuredData: StructuredData) throws {
switch structuredData {
case .numberValue(let number):
case .integerValue(let number):
self.init(number)
default:
throw InitializableError.cantBindToNeededType
Expand Down
8 changes: 4 additions & 4 deletions Sources/StructuredData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ extension StructuredData {
}

extension StructuredData {
internal func mapThrough<T>(@noescape _ transform: (StructuredData throws -> T)) throws -> [T] {
internal func mapThrough<T>(_ transform: (@noescape StructuredData throws -> T)) throws -> [T] {
if let array = self.array {
return try array.map(transform)
}
throw StructuredData.Error.incompatibleType
}

internal func mapThrough<T>(_ key: String, @noescape transform: (StructuredData throws -> T)) throws -> [T] {
internal func mapThrough<T>(_ key: String, transform: (@noescape StructuredData throws -> T)) throws -> [T] {
if let value = self[key] {
return try value.mapThrough(transform)
}
Expand All @@ -52,14 +52,14 @@ extension StructuredData {
// throw StructuredData.Error.incompatibleType
// }

internal func flatMapThrough<T>(@noescape _ transform: (StructuredData throws -> T?)) throws -> [T] {
internal func flatMapThrough<T>(_ transform: (@noescape StructuredData throws -> T?)) throws -> [T] {
if let array = self.array {
return try array.flatMap(transform)
}
throw StructuredData.Error.incompatibleType
}

internal func flatMapThrough<T>(_ key: String, @noescape transform: (StructuredData throws -> T?)) throws -> [T] {
internal func flatMapThrough<T>(_ key: String, transform: (@noescape StructuredData throws -> T?)) throws -> [T] {
if let value = self[key] {
return try value.flatMapThrough(transform)
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Mapper/InitializableTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class InitializableTests: XCTestCase {
}

func testInt() {
let structuredData: StructuredData = 5.0
let structuredData: StructuredData = 5
let int = try! Int(structuredData: structuredData)
XCTAssertEqual(int, 5)
}
Expand Down

0 comments on commit 0afb548

Please sign in to comment.