mirror of
https://github.com/gosticks/SwiftGit2.git
synced 2025-10-16 11:55:34 +00:00
17 lines
341 B
Swift
17 lines
341 B
Swift
// Once Nimble adds matchers for the Result type, remove these shims and refactor the tests that use them.
|
|
extension Result {
|
|
var value: Success? {
|
|
guard case .success(let value) = self else {
|
|
return nil
|
|
}
|
|
return value
|
|
}
|
|
|
|
var error: Failure? {
|
|
guard case .failure(let error) = self else {
|
|
return nil
|
|
}
|
|
return error
|
|
}
|
|
}
|