Skip to content

Commit

Permalink
Updated to Swft4
Browse files Browse the repository at this point in the history
  • Loading branch information
RuiAAPeres committed Nov 19, 2017
1 parent 1c371ca commit 5783b79
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0
4.0
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: objective-c
osx_image: xcode8
osx_image: xcode9
script:
- set -o pipefail
- xcodebuild test -scheme OptionalExtensions-Mac | xcpretty -c
Expand Down
4 changes: 2 additions & 2 deletions OptionalExtensions.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@
PRODUCT_NAME = OptionalExtensions;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -841,7 +841,7 @@
PRODUCT_NAME = OptionalExtensions;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand Down
6 changes: 3 additions & 3 deletions OptionalExtensions/Source/OptionalExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand All @@ -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
}
Expand Down

0 comments on commit 5783b79

Please sign in to comment.