Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated Result extension #1224

Merged
merged 1 commit into from
Jun 27, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions Sources/Utility/Result.swift
Original file line number Diff line number Diff line change
Expand Up @@ -194,43 +194,6 @@ extension Result : CustomDebugStringConvertible {
}
#endif

// Deprecated
extension Result {

/// The stored value of a successful `Result`. `nil` if the `Result` was a failure.
@available(*, deprecated, message: "This method will be removed soon. Use `get() throws -> Success` instead.")
public var value: Success? {
switch self {
case let .success(value):
return value
case .failure:
return nil
}
}

/// The stored value of a failure `Result`. `nil` if the `Result` was a success.
@available(*, deprecated, message: "This method will be removed soon. Use `get() throws -> Success` instead.")
public var error: Failure? {
switch self {
case let .failure(error):
return error
case .success:
return nil
}
}

/// A Boolean value indicating whether the `Result` as a success.
@available(*, deprecated, message: "This method will be removed soon. Use methods defined in `Swift.Result`.")
public var isSuccess: Bool {
switch self {
case .success:
return true
case .failure:
return false
}
}
}

// These helper methods are not public since we do not want them to be exposed or cause any conflicting.
// However, they are just wrapper of `ResultUtil` static methods.
extension Result where Failure: Error {
Expand Down