@@ -216,8 +216,8 @@ public func requirea<T>(fileID: String = #fileID, file: FileString = #filePath,
216
216
/// `unwrap` will return the result of the expression if it is non-nil, and throw an error if the value is nil.
217
217
/// if a `customError` is given, then that will be thrown. Otherwise, a ``RequireError`` will be thrown.
218
218
@discardableResult
219
- public func unwrap< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @autoclosure @escaping ( ) throws -> T ? ) throws -> T {
220
- try requires ( fileID: fileID, file: file, line: line, column: column, customError: customError, expression ( ) ) . toNot ( beNil ( ) )
219
+ public func unwrap< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , description : String ? = nil , _ expression: @autoclosure @escaping ( ) throws -> T ? ) throws -> T {
220
+ try requires ( fileID: fileID, file: file, line: line, column: column, customError: customError, expression ( ) ) . toNot ( beNil ( ) , description : description )
221
221
}
222
222
223
223
/// Makes sure that the expression evaluates to a non-nil value, otherwise throw an error.
@@ -226,8 +226,8 @@ public func unwrap<T>(fileID: String = #fileID, file: FileString = #filePath, li
226
226
/// `unwrap` will return the result of the expression if it is non-nil, and throw an error if the value is nil.
227
227
/// if a `customError` is given, then that will be thrown. Otherwise, a ``RequireError`` will be thrown.
228
228
@discardableResult
229
- public func unwrap< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @autoclosure ( ) -> ( ( ) throws -> T ? ) ) throws -> T {
230
- try requires ( fileID: fileID, file: file, line: line, column: column, customError: customError, expression ( ) ) . toNot ( beNil ( ) )
229
+ public func unwrap< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , description : String ? = nil , _ expression: @autoclosure ( ) -> ( ( ) throws -> T ? ) ) throws -> T {
230
+ try requires ( fileID: fileID, file: file, line: line, column: column, customError: customError, expression ( ) ) . toNot ( beNil ( ) , description : description )
231
231
}
232
232
233
233
/// Makes sure that the expression evaluates to a non-nil value, otherwise throw an error.
@@ -236,8 +236,8 @@ public func unwrap<T>(fileID: String = #fileID, file: FileString = #filePath, li
236
236
/// `unwraps` will return the result of the expression if it is non-nil, and throw an error if the value is nil.
237
237
/// if a `customError` is given, then that will be thrown. Otherwise, a ``RequireError`` will be thrown.
238
238
@discardableResult
239
- public func unwraps< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @autoclosure @escaping ( ) throws -> T ? ) throws -> T {
240
- try requires ( fileID: fileID, file: file, line: line, column: column, customError: customError, expression ( ) ) . toNot ( beNil ( ) )
239
+ public func unwraps< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , description : String ? = nil , _ expression: @autoclosure @escaping ( ) throws -> T ? ) throws -> T {
240
+ try requires ( fileID: fileID, file: file, line: line, column: column, customError: customError, expression ( ) ) . toNot ( beNil ( ) , description : description )
241
241
}
242
242
243
243
/// Makes sure that the expression evaluates to a non-nil value, otherwise throw an error.
@@ -246,8 +246,8 @@ public func unwraps<T>(fileID: String = #fileID, file: FileString = #filePath, l
246
246
/// `unwraps` will return the result of the expression if it is non-nil, and throw an error if the value is nil.
247
247
/// if a `customError` is given, then that will be thrown. Otherwise, a ``RequireError`` will be thrown.
248
248
@discardableResult
249
- public func unwraps< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @autoclosure ( ) -> ( ( ) throws -> T ? ) ) throws -> T {
250
- try requires ( fileID: fileID, file: file, line: line, column: column, customError: customError, expression ( ) ) . toNot ( beNil ( ) )
249
+ public func unwraps< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , description : String ? = nil , _ expression: @autoclosure ( ) -> ( ( ) throws -> T ? ) ) throws -> T {
250
+ try requires ( fileID: fileID, file: file, line: line, column: column, customError: customError, expression ( ) ) . toNot ( beNil ( ) , description : description )
251
251
}
252
252
253
253
/// Makes sure that the async expression evaluates to a non-nil value, otherwise throw an error.
@@ -256,8 +256,8 @@ public func unwraps<T>(fileID: String = #fileID, file: FileString = #filePath, l
256
256
/// `unwrap` will return the result of the expression if it is non-nil, and throw an error if the value is nil.
257
257
/// if a `customError` is given, then that will be thrown. Otherwise, a ``RequireError`` will be thrown.
258
258
@discardableResult
259
- public func unwrap< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @escaping ( ) async throws -> T ? ) async throws -> T {
260
- try await requirea ( fileID: fileID, file: file, line: line, column: column, customError: customError, try await expression ( ) ) . toNot ( beNil ( ) )
259
+ public func unwrap< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , description : String ? = nil , _ expression: @escaping ( ) async throws -> T ? ) async throws -> T {
260
+ try await requirea ( fileID: fileID, file: file, line: line, column: column, customError: customError, try await expression ( ) ) . toNot ( beNil ( ) , description : description )
261
261
}
262
262
263
263
/// Makes sure that the async expression evaluates to a non-nil value, otherwise throw an error.
@@ -266,8 +266,8 @@ public func unwrap<T>(fileID: String = #fileID, file: FileString = #filePath, li
266
266
/// `unwrap` will return the result of the expression if it is non-nil, and throw an error if the value is nil.
267
267
/// if a `customError` is given, then that will be thrown. Otherwise, a ``RequireError`` will be thrown.
268
268
@discardableResult
269
- public func unwrap< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: ( ) -> ( ( ) async throws -> T ? ) ) async throws -> T {
270
- try await requirea ( fileID: fileID, file: file, line: line, column: column, customError: customError, expression ( ) ) . toNot ( beNil ( ) )
269
+ public func unwrap< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , description : String ? = nil , _ expression: ( ) -> ( ( ) async throws -> T ? ) ) async throws -> T {
270
+ try await requirea ( fileID: fileID, file: file, line: line, column: column, customError: customError, expression ( ) ) . toNot ( beNil ( ) , description : description )
271
271
}
272
272
273
273
/// Makes sure that the async expression evaluates to a non-nil value, otherwise throw an error.
@@ -276,8 +276,8 @@ public func unwrap<T>(fileID: String = #fileID, file: FileString = #filePath, li
276
276
/// `unwrapa` will return the result of the expression if it is non-nil, and throw an error if the value is nil.
277
277
/// if a `customError` is given, then that will be thrown. Otherwise, a ``RequireError`` will be thrown.
278
278
@discardableResult
279
- public func unwrapa< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @autoclosure @escaping ( ) async throws -> T ? ) async throws -> T {
280
- try await requirea ( fileID: fileID, file: file, line: line, column: column, customError: customError, try await expression ( ) ) . toNot ( beNil ( ) )
279
+ public func unwrapa< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , description : String ? = nil , _ expression: @autoclosure @escaping ( ) async throws -> T ? ) async throws -> T {
280
+ try await requirea ( fileID: fileID, file: file, line: line, column: column, customError: customError, try await expression ( ) ) . toNot ( beNil ( ) , description : description )
281
281
}
282
282
283
283
/// Makes sure that the async expression evaluates to a non-nil value, otherwise throw an error.
@@ -286,6 +286,6 @@ public func unwrapa<T>(fileID: String = #fileID, file: FileString = #filePath, l
286
286
/// `unwrapa` will return the result of the expression if it is non-nil, and throw an error if the value is nil.
287
287
/// if a `customError` is given, then that will be thrown. Otherwise, a ``RequireError`` will be thrown.
288
288
@discardableResult
289
- public func unwrapa< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @autoclosure ( ) -> ( ( ) async throws -> T ? ) ) async throws -> T {
290
- try await requirea ( fileID: fileID, file: file, line: line, column: column, customError: customError, expression ( ) ) . toNot ( beNil ( ) )
289
+ public func unwrapa< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , description : String ? = nil , _ expression: @autoclosure ( ) -> ( ( ) async throws -> T ? ) ) async throws -> T {
290
+ try await requirea ( fileID: fileID, file: file, line: line, column: column, customError: customError, expression ( ) ) . toNot ( beNil ( ) , description : description )
291
291
}
0 commit comments