Skip to content

Commit 467294e

Browse files
committed
Add more inlinable notations after git merge
feature/add-inlinable-notations-to-encourage-generic-specialization
1 parent 3a7c68e commit 467294e

6 files changed

Lines changed: 9 additions & 3 deletions

Sources/CoreDataRepository/CoreDataBatchError.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ public struct CoreDataBatchError<T>: Error {
2121
/// The underlying error.
2222
public let error: CoreDataError
2323

24+
@inlinable
2425
public var localizedDescription: String {
2526
error.localizedDescription
2627
}
2728

29+
@inlinable
2830
public init(item: T, error: CoreDataError) {
2931
self.item = item
3032
self.error = error

Sources/CoreDataRepository/CoreDataError.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ public enum CoreDataError: Error, Hashable, Sendable {
108108
extension CoreDataError: CustomNSError {
109109
public static let errorDomain: String = "CoreDataRepository"
110110

111+
@inlinable
111112
public var errorCode: Int {
112113
switch self {
113114
case .failedToGetObjectIdFromUrl:
@@ -133,6 +134,7 @@ extension CoreDataError: CustomNSError {
133134

134135
public static let urlUserInfoKey: String = "ObjectIdUrl"
135136

137+
@inlinable
136138
public var errorUserInfo: [String: Any] {
137139
switch self {
138140
case let .failedToGetObjectIdFromUrl(url):

Sources/CoreDataRepository/CoreDataRepository+Custom.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ extension CoreDataRepository {
1515
///
1616
/// The caller is responsible for saving the contexts and cleaning up if needed.
1717
/// All this method provides is the contexts and mapping `Error` into ``CoreDataError``.
18+
@inlinable
1819
public func custom<T>(
1920
schedule: NSManagedObjectContext.ScheduledTaskType = .enqueued,
2021
block: @escaping (

Sources/CoreDataRepository/CoreDataRepository.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public final class CoreDataRepository {
2929
/// to be performed in.
3030
public let context: NSManagedObjectContext
3131

32+
@inlinable
3233
public init(context: NSManagedObjectContext) {
3334
self.context = context
3435
}

Sources/CoreDataRepository/NSManagedObject+Helpers.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Foundation
1111

1212
extension NSManagedObject {
1313
/// Helper function to handle casting ``NSManagedObject`` to a sub-class.
14-
@inlinable
14+
@inlinable
1515
public func asManagedModel<T>() throws -> T where T: NSManagedObject {
1616
guard let repoManaged = self as? T else {
1717
throw CoreDataError.fetchedObjectFailedToCastToExpectedType

Sources/CoreDataRepository/NSManagedObjectContext+Helpers.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Foundation
1111

1212
extension NSManagedObjectContext {
1313
/// Helper function for getting the ``NSManagedObjectID`` from an ``URL``
14-
@inlinable
14+
@inlinable
1515
public func objectId(from url: URL) -> Result<NSManagedObjectID, CoreDataError> {
1616
guard let objectId = persistentStoreCoordinator?.managedObjectID(forURIRepresentation: url) else {
1717
return .failure(CoreDataError.failedToGetObjectIdFromUrl(url))
@@ -20,7 +20,7 @@ extension NSManagedObjectContext {
2020
}
2121

2222
/// Helper function for checking that a managed object is not deleted in the store
23-
@inlinable
23+
@inlinable
2424
public func notDeletedObject(for id: NSManagedObjectID) throws -> NSManagedObject {
2525
let object: NSManagedObject = try existingObject(with: id)
2626
guard !object.isDeleted else {

0 commit comments

Comments
 (0)