Skip to content

Commit c4e4002

Browse files
committed
Make fetchCount generic over the result type
...
1 parent 2998b0c commit c4e4002

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/ManagedModels/Context/NSManagedObjectContext+Data.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ public extension NSManagedObjectContext {
4848
public extension NSManagedObjectContext {
4949

5050
@inlinable
51-
func fetchCount(_ request: NSFetchRequest<NSFetchRequestResult>) throws -> Int
51+
func fetchCount<T>(_ request: NSFetchRequest<T>) throws -> Int
52+
where T: NSFetchRequestResult
5253
{
5354
try count(for: request)
5455
}

0 commit comments

Comments
 (0)