Skip to content

Commit 715a397

Browse files
committed
Add docs to Bool+Require
1 parent 9e533a1 commit 715a397

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Sources/BuddyFoundation/Foundation/Bool+Require.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
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).
25
@discardableResult
36
func require(_ error: Error) throws -> Self {
47
guard self else { throw error }

0 commit comments

Comments
 (0)