Created Failable<Bool, T>.toggle() method
This commit is contained in:
parent
f25f2abf10
commit
ec8febb489
|
@ -0,0 +1,7 @@
|
|||
extension Failable where T == Bool {
|
||||
|
||||
/// See [`Bool.toggle()`](https://developer.apple.com/documentation/swift/bool/2994863-toggle).
|
||||
public mutating func toggle()throws {
|
||||
try self <~ !self.value
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue