From ac871333babaf8e18496e59273aa0264f8b5e13c Mon Sep 17 00:00:00 2001 From: John Burwell Date: Mon, 1 Jun 2026 09:02:19 -0500 Subject: [PATCH] Fix nonisolated model warnings --- .../Models/Content/LibraryIndex.swift | 18 +++++++++--------- .../Models/Sources/MinecraftSource.swift | 4 ++-- .../Models/Sources/SourceCapabilities.swift | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/World Manager for Minecraft/Models/Content/LibraryIndex.swift b/World Manager for Minecraft/Models/Content/LibraryIndex.swift index a52a58a..938b534 100644 --- a/World Manager for Minecraft/Models/Content/LibraryIndex.swift +++ b/World Manager for Minecraft/Models/Content/LibraryIndex.swift @@ -3,12 +3,12 @@ import Foundation -enum PackIdentitySource: String, Hashable, Sendable { +nonisolated enum PackIdentitySource: String, Hashable, Sendable { case manifestUUID case fallback } -struct PackIdentity: Hashable, Sendable, Identifiable { +nonisolated struct PackIdentity: Hashable, Sendable, Identifiable { let type: MinecraftContentType let uuid: String? let version: String? @@ -96,7 +96,7 @@ struct PackIdentity: Hashable, Sendable, Identifiable { } } -struct PackInstance: Identifiable, Hashable, Sendable { +nonisolated struct PackInstance: Identifiable, Hashable, Sendable { let id: URL let itemID: URL let sourceID: URL @@ -105,7 +105,7 @@ struct PackInstance: Identifiable, Hashable, Sendable { let hostWorldItemID: URL? } -struct LogicalPack: Identifiable, Hashable, Sendable { +nonisolated struct LogicalPack: Identifiable, Hashable, Sendable { let id: PackIdentity let contentType: MinecraftContentType let displayName: String @@ -116,14 +116,14 @@ struct LogicalPack: Identifiable, Hashable, Sendable { let isSuspicious: Bool } -struct LogicalWorld: Identifiable, Hashable, Sendable { +nonisolated struct LogicalWorld: Identifiable, Hashable, Sendable { let id: URL let itemID: URL let usedPackIDs: [PackIdentity] let unresolvedReferences: [ContentPackReference] } -struct WorldPackRelationship: Identifiable, Hashable, Sendable { +nonisolated struct WorldPackRelationship: Identifiable, Hashable, Sendable { let worldItemID: URL let logicalPackID: PackIdentity? let reference: ContentPackReference @@ -137,7 +137,7 @@ struct WorldPackRelationship: Identifiable, Hashable, Sendable { } } -struct ItemSnapshot: Identifiable, Hashable, Sendable, Codable { +nonisolated struct ItemSnapshot: Identifiable, Hashable, Sendable, Codable { let id: URL let relativePath: String let modifiedDate: Date? @@ -146,7 +146,7 @@ struct ItemSnapshot: Identifiable, Hashable, Sendable, Codable { let packVersion: String? } -struct CollectionSnapshot: Identifiable, Hashable, Sendable, Codable { +nonisolated struct CollectionSnapshot: Identifiable, Hashable, Sendable, Codable { let folderName: String let modifiedDate: Date? let childDirectoryCount: Int @@ -155,7 +155,7 @@ struct CollectionSnapshot: Identifiable, Hashable, Sendable, Codable { var id: String { folderName } } -struct SourceSnapshot: Hashable, Sendable, Codable { +nonisolated struct SourceSnapshot: Hashable, Sendable, Codable { let sourceID: URL let rootModifiedDate: Date? let collectionSnapshots: [CollectionSnapshot] diff --git a/World Manager for Minecraft/Models/Sources/MinecraftSource.swift b/World Manager for Minecraft/Models/Sources/MinecraftSource.swift index 658a5e5..aed7341 100644 --- a/World Manager for Minecraft/Models/Sources/MinecraftSource.swift +++ b/World Manager for Minecraft/Models/Sources/MinecraftSource.swift @@ -3,7 +3,7 @@ import Foundation -struct MinecraftSource: Identifiable, Hashable, Sendable { +nonisolated struct MinecraftSource: Identifiable, Hashable, Sendable { let id: URL let folderURL: URL var origin: MinecraftSourceOrigin @@ -197,7 +197,7 @@ nonisolated private func normalizedSourceURL(_ url: URL) -> URL { } private extension Array { - func uniqued(by keyPath: KeyPath) -> [Element] { + nonisolated func uniqued(by keyPath: KeyPath) -> [Element] { var seen = Set() var result: [Element] = [] diff --git a/World Manager for Minecraft/Models/Sources/SourceCapabilities.swift b/World Manager for Minecraft/Models/Sources/SourceCapabilities.swift index 832c883..031de38 100644 --- a/World Manager for Minecraft/Models/Sources/SourceCapabilities.swift +++ b/World Manager for Minecraft/Models/Sources/SourceCapabilities.swift @@ -3,7 +3,7 @@ import Foundation -struct SourceCapabilities: Hashable, Sendable, Codable { +nonisolated struct SourceCapabilities: Hashable, Sendable, Codable { var canScan: Bool = true var canMaterializeItems: Bool = true var canExportPortablePackages: Bool = true