Added SignedNumeric stubs to Failable<SignedNumeric, T> type
This commit is contained in:
parent
7a59f94624
commit
f1bcd4ef2c
|
@ -0,0 +1,12 @@
|
|||
extension Failable where T: SignedNumeric {
|
||||
|
||||
/// See [`SignedNumeric.negate()`](https://developer.apple.com/documentation/swift/signednumeric/2883859-negate).
|
||||
public mutating func negate()throws {
|
||||
try self = -self
|
||||
}
|
||||
|
||||
/// See [`SignedNumeric.-(_:)`](https://developer.apple.com/documentation/swift/signednumeric/2965579).
|
||||
public static prefix func - (lhs: Failable<T, Validations>)throws -> Failable<T, Validations> {
|
||||
return try Failable(-lhs.value)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue