mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SDK] Rename several small overlay source files. (#4520)
...to remove the temptation to put everything in one file with the same name as the module. This doesn't do anything for overlays that /already/ have everything in one file with the same name as the module, except for a few easy cases; we can unpack the rest later.
This commit is contained in:
12
stdlib/public/SDK/CoreData/NSManagedObjectContext.swift
Normal file
12
stdlib/public/SDK/CoreData/NSManagedObjectContext.swift
Normal file
@@ -0,0 +1,12 @@
|
||||
@_exported import CoreData
|
||||
import Foundation
|
||||
|
||||
extension NSManagedObjectContext {
|
||||
public func fetch<T: NSFetchRequestResult>(_ request: NSFetchRequest<T>) throws -> [T] {
|
||||
return try fetch(unsafeBitCast(request, to: NSFetchRequest<NSFetchRequestResult>.self)) as! [T]
|
||||
}
|
||||
|
||||
public func count<T: NSFetchRequestResult>(for request: NSFetchRequest<T>) throws -> Int {
|
||||
return try count(for: unsafeBitCast(request, to: NSFetchRequest<NSFetchRequestResult>.self))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user