We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9e533a1 commit 715a397Copy full SHA for 715a397
Sources/BuddyFoundation/Foundation/Bool+Require.swift
@@ -1,4 +1,7 @@
1
public extension Bool {
2
+ /// Throws an error if the bool value is `false`.
3
+ /// - Parameter error: The error to throw if the value is `false`.
4
+ /// - Returns: `true` if the value was true (discardable result).
5
@discardableResult
6
func require(_ error: Error) throws -> Self {
7
guard self else { throw error }
0 commit comments