diff --git a/.swift-version b/.swift-version index 9f55b2c..5186d07 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -3.0 +4.0 diff --git a/.travis.yml b/.travis.yml index cfa256b..d532a53 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: objective-c -osx_image: xcode8 +osx_image: xcode9 script: - set -o pipefail - xcodebuild test -scheme OptionalExtensions-Mac | xcpretty -c diff --git a/OptionalExtensions.xcodeproj/project.pbxproj b/OptionalExtensions.xcodeproj/project.pbxproj index bfea69c..3f7d8d2 100644 --- a/OptionalExtensions.xcodeproj/project.pbxproj +++ b/OptionalExtensions.xcodeproj/project.pbxproj @@ -822,7 +822,7 @@ PRODUCT_NAME = OptionalExtensions; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -841,7 +841,7 @@ PRODUCT_NAME = OptionalExtensions; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/OptionalExtensions/Source/OptionalExtensions.swift b/OptionalExtensions/Source/OptionalExtensions.swift index c1ded18..4dc469d 100644 --- a/OptionalExtensions/Source/OptionalExtensions.swift +++ b/OptionalExtensions/Source/OptionalExtensions.swift @@ -12,11 +12,11 @@ public extension Optional { return map(predicate) == .some(true) ? self : .none } - func mapNil(_ predicate: (Void) -> Wrapped) -> Optional { + func mapNil(_ predicate: () -> Wrapped) -> Optional { return self ?? .some(predicate()) } - func flatMapNil(_ predicate: (Void) -> Optional) -> Optional { + func flatMapNil(_ predicate: () -> Optional) -> Optional { return self ?? predicate() } @@ -33,7 +33,7 @@ public extension Optional { return self } - func onNone(_ f: (Void) -> Void) -> Optional { + func onNone(_ f: () -> Void) -> Optional { if isNone { f() } return self }