Created
September 11, 2015 15:33
-
-
Save imownbey/e389a266c46622dd72ca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Optional { | |
func unwrappedOr(value: Wrapped) -> Wrapped { | |
switch self { | |
case .Some: | |
return self! | |
case .None: | |
return value | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment