diff --git a/IGDB-SWIFT-API.podspec b/IGDB-SWIFT-API.podspec index 4aca7d4..eed5f05 100644 --- a/IGDB-SWIFT-API.podspec +++ b/IGDB-SWIFT-API.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'IGDB-SWIFT-API' - s.version = '0.3.5' + s.version = '0.3.6' s.summary = 'Wrapper for IGDBs API written in Swift.' s.description = "A Swift wrapper for the IGDB.com Free Video Game Database API." s.documentation_url = "https://api-docs.igdb.com" @@ -13,6 +13,6 @@ Pod::Spec.new do |s| s.swift_version = '5.0' s.source_files = 'Sources/IGDB-SWIFT-API/**/*.swift' - s.dependency 'SwiftProtobuf', '~> 1.6.0' + s.dependency 'SwiftProtobuf', '~> 1.18.0' s.dependency 'Just', '~> 0.8.0' end diff --git a/Package.resolved b/Package.resolved index 390a6a4..7bd167a 100644 --- a/Package.resolved +++ b/Package.resolved @@ -15,8 +15,8 @@ "repositoryURL": "https://github.com/apple/swift-protobuf.git", "state": { "branch": null, - "revision": "0279688c9fc5a40028e1b5bb0cb56534a45a6020", - "version": "1.12.0" + "revision": "7e2c5f3cbbeea68e004915e3a8961e20bd11d824", + "version": "1.18.0" } } ] diff --git a/Package.swift b/Package.swift index 1387f2e..4fa96e2 100644 --- a/Package.swift +++ b/Package.swift @@ -17,7 +17,7 @@ let package = Package( ], dependencies: [ .package(url: "https://github.com/dduan/Just.git", from: "0.8.0"), - .package(url: "https://github.com/apple/swift-protobuf.git", from: "1.6.0") + .package(url: "https://github.com/apple/swift-protobuf.git", from: "1.18.0") ], targets: [ .target( diff --git a/Sources/IGDB-SWIFT-API/APIStructs/IGDBProtoFile.pb.swift b/Sources/IGDB-SWIFT-API/APIStructs/IGDBProtoFile.pb.swift index 0b0e697..670fb9c 100644 --- a/Sources/IGDB-SWIFT-API/APIStructs/IGDBProtoFile.pb.swift +++ b/Sources/IGDB-SWIFT-API/APIStructs/IGDBProtoFile.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: igdbproto.txt +// Source: igdbapi.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ @@ -25,6 +25,11 @@ public enum Proto_AgeRatingCategoryEnum: SwiftProtobuf.Enum { case ageratingCategoryNull // = 0 case esrb // = 1 case pegi // = 2 + case cero // = 3 + case usk // = 4 + case grac // = 5 + case classInd // = 6 + case acb // = 7 case UNRECOGNIZED(Int) public init() { @@ -36,6 +41,11 @@ public enum Proto_AgeRatingCategoryEnum: SwiftProtobuf.Enum { case 0: self = .ageratingCategoryNull case 1: self = .esrb case 2: self = .pegi + case 3: self = .cero + case 4: self = .usk + case 5: self = .grac + case 6: self = .classInd + case 7: self = .acb default: self = .UNRECOGNIZED(rawValue) } } @@ -45,6 +55,11 @@ public enum Proto_AgeRatingCategoryEnum: SwiftProtobuf.Enum { case .ageratingCategoryNull: return 0 case .esrb: return 1 case .pegi: return 2 + case .cero: return 3 + case .usk: return 4 + case .grac: return 5 + case .classInd: return 6 + case .acb: return 7 case .UNRECOGNIZED(let i): return i } } @@ -59,6 +74,11 @@ extension Proto_AgeRatingCategoryEnum: CaseIterable { .ageratingCategoryNull, .esrb, .pegi, + .cero, + .usk, + .grac, + .classInd, + .acb, ] } @@ -79,6 +99,32 @@ public enum Proto_AgeRatingRatingEnum: SwiftProtobuf.Enum { case t // = 10 case m // = 11 case ao // = 12 + case ceroA // = 13 + case ceroB // = 14 + case ceroC // = 15 + case ceroD // = 16 + case ceroZ // = 17 + case usk0 // = 18 + case usk6 // = 19 + case usk12 // = 20 + case usk18 // = 21 + case gracAll // = 22 + case gracTwelve // = 23 + case gracFifteen // = 24 + case gracEighteen // = 25 + case gracTesting // = 26 + case classIndL // = 27 + case classIndTen // = 28 + case classIndTwelve // = 29 + case classIndFourteen // = 30 + case classIndSixteen // = 31 + case classIndEighteen // = 32 + case acbG // = 33 + case acbPg // = 34 + case acbM // = 35 + case acbMa15 // = 36 + case acbR18 // = 37 + case acbRc // = 38 case UNRECOGNIZED(Int) public init() { @@ -100,6 +146,32 @@ public enum Proto_AgeRatingRatingEnum: SwiftProtobuf.Enum { case 10: self = .t case 11: self = .m case 12: self = .ao + case 13: self = .ceroA + case 14: self = .ceroB + case 15: self = .ceroC + case 16: self = .ceroD + case 17: self = .ceroZ + case 18: self = .usk0 + case 19: self = .usk6 + case 20: self = .usk12 + case 21: self = .usk18 + case 22: self = .gracAll + case 23: self = .gracTwelve + case 24: self = .gracFifteen + case 25: self = .gracEighteen + case 26: self = .gracTesting + case 27: self = .classIndL + case 28: self = .classIndTen + case 29: self = .classIndTwelve + case 30: self = .classIndFourteen + case 31: self = .classIndSixteen + case 32: self = .classIndEighteen + case 33: self = .acbG + case 34: self = .acbPg + case 35: self = .acbM + case 36: self = .acbMa15 + case 37: self = .acbR18 + case 38: self = .acbRc default: self = .UNRECOGNIZED(rawValue) } } @@ -119,6 +191,32 @@ public enum Proto_AgeRatingRatingEnum: SwiftProtobuf.Enum { case .t: return 10 case .m: return 11 case .ao: return 12 + case .ceroA: return 13 + case .ceroB: return 14 + case .ceroC: return 15 + case .ceroD: return 16 + case .ceroZ: return 17 + case .usk0: return 18 + case .usk6: return 19 + case .usk12: return 20 + case .usk18: return 21 + case .gracAll: return 22 + case .gracTwelve: return 23 + case .gracFifteen: return 24 + case .gracEighteen: return 25 + case .gracTesting: return 26 + case .classIndL: return 27 + case .classIndTen: return 28 + case .classIndTwelve: return 29 + case .classIndFourteen: return 30 + case .classIndSixteen: return 31 + case .classIndEighteen: return 32 + case .acbG: return 33 + case .acbPg: return 34 + case .acbM: return 35 + case .acbMa15: return 36 + case .acbR18: return 37 + case .acbRc: return 38 case .UNRECOGNIZED(let i): return i } } @@ -143,6 +241,32 @@ extension Proto_AgeRatingRatingEnum: CaseIterable { .t, .m, .ao, + .ceroA, + .ceroB, + .ceroC, + .ceroD, + .ceroZ, + .usk0, + .usk6, + .usk12, + .usk18, + .gracAll, + .gracTwelve, + .gracFifteen, + .gracEighteen, + .gracTesting, + .classIndL, + .classIndTen, + .classIndTwelve, + .classIndFourteen, + .classIndSixteen, + .classIndEighteen, + .acbG, + .acbPg, + .acbM, + .acbMa15, + .acbR18, + .acbRc, ] } @@ -426,6 +550,11 @@ public enum Proto_ExternalGameCategoryEnum: SwiftProtobuf.Enum { case externalgameApple // = 13 case externalgameTwitch // = 14 case externalgameAndroid // = 15 + case externalgameAmazonAsin // = 20 + case externalgameAmazonLuna // = 22 + case externalgameAmazonAdg // = 23 + case externalgameEpicGameStore // = 26 + case externalgameOculus // = 28 case UNRECOGNIZED(Int) public init() { @@ -442,6 +571,11 @@ public enum Proto_ExternalGameCategoryEnum: SwiftProtobuf.Enum { case 13: self = .externalgameApple case 14: self = .externalgameTwitch case 15: self = .externalgameAndroid + case 20: self = .externalgameAmazonAsin + case 22: self = .externalgameAmazonLuna + case 23: self = .externalgameAmazonAdg + case 26: self = .externalgameEpicGameStore + case 28: self = .externalgameOculus default: self = .UNRECOGNIZED(rawValue) } } @@ -456,6 +590,11 @@ public enum Proto_ExternalGameCategoryEnum: SwiftProtobuf.Enum { case .externalgameApple: return 13 case .externalgameTwitch: return 14 case .externalgameAndroid: return 15 + case .externalgameAmazonAsin: return 20 + case .externalgameAmazonLuna: return 22 + case .externalgameAmazonAdg: return 23 + case .externalgameEpicGameStore: return 26 + case .externalgameOculus: return 28 case .UNRECOGNIZED(let i): return i } } @@ -475,6 +614,11 @@ extension Proto_ExternalGameCategoryEnum: CaseIterable { .externalgameApple, .externalgameTwitch, .externalgameAndroid, + .externalgameAmazonAsin, + .externalgameAmazonLuna, + .externalgameAmazonAdg, + .externalgameEpicGameStore, + .externalgameOculus, ] } @@ -617,6 +761,7 @@ public enum Proto_GameStatusEnum: SwiftProtobuf.Enum { case offline // = 5 case cancelled // = 6 case rumored // = 7 + case delisted // = 8 case UNRECOGNIZED(Int) public init() { @@ -632,6 +777,7 @@ public enum Proto_GameStatusEnum: SwiftProtobuf.Enum { case 5: self = .offline case 6: self = .cancelled case 7: self = .rumored + case 8: self = .delisted default: self = .UNRECOGNIZED(rawValue) } } @@ -645,6 +791,7 @@ public enum Proto_GameStatusEnum: SwiftProtobuf.Enum { case .offline: return 5 case .cancelled: return 6 case .rumored: return 7 + case .delisted: return 8 case .UNRECOGNIZED(let i): return i } } @@ -663,6 +810,7 @@ extension Proto_GameStatusEnum: CaseIterable { .offline, .cancelled, .rumored, + .delisted, ] } @@ -823,6 +971,8 @@ public enum Proto_RegionRegionEnum: SwiftProtobuf.Enum { case china // = 6 case asia // = 7 case worldwide // = 8 + case korea // = 9 + case brazil // = 10 case UNRECOGNIZED(Int) public init() { @@ -840,6 +990,8 @@ public enum Proto_RegionRegionEnum: SwiftProtobuf.Enum { case 6: self = .china case 7: self = .asia case 8: self = .worldwide + case 9: self = .korea + case 10: self = .brazil default: self = .UNRECOGNIZED(rawValue) } } @@ -855,6 +1007,8 @@ public enum Proto_RegionRegionEnum: SwiftProtobuf.Enum { case .china: return 6 case .asia: return 7 case .worldwide: return 8 + case .korea: return 9 + case .brazil: return 10 case .UNRECOGNIZED(let i): return i } } @@ -875,6 +1029,8 @@ extension Proto_RegionRegionEnum: CaseIterable { .china, .asia, .worldwide, + .korea, + .brazil, ] } @@ -3721,6 +3877,11 @@ extension Proto_AgeRatingCategoryEnum: SwiftProtobuf._ProtoNameProviding { 0: .same(proto: "AGERATING_CATEGORY_NULL"), 1: .same(proto: "ESRB"), 2: .same(proto: "PEGI"), + 3: .same(proto: "CERO"), + 4: .same(proto: "USK"), + 5: .same(proto: "GRAC"), + 6: .same(proto: "CLASS_IND"), + 7: .same(proto: "ACB"), ] } @@ -3739,6 +3900,32 @@ extension Proto_AgeRatingRatingEnum: SwiftProtobuf._ProtoNameProviding { 10: .same(proto: "T"), 11: .same(proto: "M"), 12: .same(proto: "AO"), + 13: .same(proto: "CERO_A"), + 14: .same(proto: "CERO_B"), + 15: .same(proto: "CERO_C"), + 16: .same(proto: "CERO_D"), + 17: .same(proto: "CERO_Z"), + 18: .same(proto: "USK_0"), + 19: .same(proto: "USK_6"), + 20: .same(proto: "USK_12"), + 21: .same(proto: "USK_18"), + 22: .same(proto: "GRAC_ALL"), + 23: .same(proto: "GRAC_TWELVE"), + 24: .same(proto: "GRAC_FIFTEEN"), + 25: .same(proto: "GRAC_EIGHTEEN"), + 26: .same(proto: "GRAC_TESTING"), + 27: .same(proto: "CLASS_IND_L"), + 28: .same(proto: "CLASS_IND_TEN"), + 29: .same(proto: "CLASS_IND_TWELVE"), + 30: .same(proto: "CLASS_IND_FOURTEEN"), + 31: .same(proto: "CLASS_IND_SIXTEEN"), + 32: .same(proto: "CLASS_IND_EIGHTEEN"), + 33: .same(proto: "ACB_G"), + 34: .same(proto: "ACB_PG"), + 35: .same(proto: "ACB_M"), + 36: .same(proto: "ACB_MA15"), + 37: .same(proto: "ACB_R18"), + 38: .same(proto: "ACB_RC"), ] } @@ -3807,6 +3994,11 @@ extension Proto_ExternalGameCategoryEnum: SwiftProtobuf._ProtoNameProviding { 13: .same(proto: "EXTERNALGAME_APPLE"), 14: .same(proto: "EXTERNALGAME_TWITCH"), 15: .same(proto: "EXTERNALGAME_ANDROID"), + 20: .same(proto: "EXTERNALGAME_AMAZON_ASIN"), + 22: .same(proto: "EXTERNALGAME_AMAZON_LUNA"), + 23: .same(proto: "EXTERNALGAME_AMAZON_ADG"), + 26: .same(proto: "EXTERNALGAME_EPIC_GAME_STORE"), + 28: .same(proto: "EXTERNALGAME_OCULUS"), ] } @@ -3845,6 +4037,7 @@ extension Proto_GameStatusEnum: SwiftProtobuf._ProtoNameProviding { 5: .same(proto: "OFFLINE"), 6: .same(proto: "CANCELLED"), 7: .same(proto: "RUMORED"), + 8: .same(proto: "DELISTED"), ] } @@ -3886,6 +4079,8 @@ extension Proto_RegionRegionEnum: SwiftProtobuf._ProtoNameProviding { 6: .same(proto: "CHINA"), 7: .same(proto: "ASIA"), 8: .same(proto: "WORLDWIDE"), + 9: .same(proto: "KOREA"), + 10: .same(proto: "BRAZIL"), ] } @@ -4246,15 +4441,19 @@ extension Proto_AlternativeName: SwiftProtobuf.Message, SwiftProtobuf._MessageIm } public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if self.id != 0 { try visitor.visitSingularUInt64Field(value: self.id, fieldNumber: 1) } if !self.comment.isEmpty { try visitor.visitSingularStringField(value: self.comment, fieldNumber: 2) } - if let v = self._game { + try { if let v = self._game { try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } + } }() if !self.name.isEmpty { try visitor.visitSingularStringField(value: self.name, fieldNumber: 4) } @@ -4342,6 +4541,10 @@ extension Proto_Artwork: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementa } public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if self.id != 0 { try visitor.visitSingularUInt64Field(value: self.id, fieldNumber: 1) } @@ -4351,9 +4554,9 @@ extension Proto_Artwork: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementa if self.animated != false { try visitor.visitSingularBoolField(value: self.animated, fieldNumber: 3) } - if let v = self._game { + try { if let v = self._game { try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } + } }() if self.height != 0 { try visitor.visitSingularInt32Field(value: self.height, fieldNumber: 5) } @@ -4513,6 +4716,10 @@ extension Proto_Character: SwiftProtobuf.Message, SwiftProtobuf._MessageImplemen public func traverse(visitor: inout V) throws { try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if _storage._id != 0 { try visitor.visitSingularUInt64Field(value: _storage._id, fieldNumber: 1) } @@ -4522,9 +4729,9 @@ extension Proto_Character: SwiftProtobuf.Message, SwiftProtobuf._MessageImplemen if !_storage._countryName.isEmpty { try visitor.visitSingularStringField(value: _storage._countryName, fieldNumber: 3) } - if let v = _storage._createdAt { + try { if let v = _storage._createdAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } + } }() if !_storage._description_p.isEmpty { try visitor.visitSingularStringField(value: _storage._description_p, fieldNumber: 5) } @@ -4534,9 +4741,9 @@ extension Proto_Character: SwiftProtobuf.Message, SwiftProtobuf._MessageImplemen if _storage._gender != .male { try visitor.visitSingularEnumField(value: _storage._gender, fieldNumber: 7) } - if let v = _storage._mugShot { + try { if let v = _storage._mugShot { try visitor.visitSingularMessageField(value: v, fieldNumber: 8) - } + } }() if !_storage._name.isEmpty { try visitor.visitSingularStringField(value: _storage._name, fieldNumber: 9) } @@ -4546,9 +4753,9 @@ extension Proto_Character: SwiftProtobuf.Message, SwiftProtobuf._MessageImplemen if _storage._species != .characterSpeciesNull { try visitor.visitSingularEnumField(value: _storage._species, fieldNumber: 11) } - if let v = _storage._updatedAt { + try { if let v = _storage._updatedAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 12) - } + } }() if !_storage._url.isEmpty { try visitor.visitSingularStringField(value: _storage._url, fieldNumber: 13) } @@ -4758,12 +4965,16 @@ extension Proto_Collection: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme } public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if self.id != 0 { try visitor.visitSingularUInt64Field(value: self.id, fieldNumber: 1) } - if let v = self._createdAt { + try { if let v = self._createdAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } + } }() if !self.games.isEmpty { try visitor.visitRepeatedMessageField(value: self.games, fieldNumber: 3) } @@ -4773,9 +4984,9 @@ extension Proto_Collection: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme if !self.slug.isEmpty { try visitor.visitSingularStringField(value: self.slug, fieldNumber: 5) } - if let v = self._updatedAt { + try { if let v = self._updatedAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - } + } }() if !self.url.isEmpty { try visitor.visitSingularStringField(value: self.url, fieldNumber: 7) } @@ -4945,54 +5156,58 @@ extension Proto_Company: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementa public func traverse(visitor: inout V) throws { try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if _storage._id != 0 { try visitor.visitSingularUInt64Field(value: _storage._id, fieldNumber: 1) } - if let v = _storage._changeDate { + try { if let v = _storage._changeDate { try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } + } }() if _storage._changeDateCategory != .yyyymmmmdd { try visitor.visitSingularEnumField(value: _storage._changeDateCategory, fieldNumber: 3) } - if let v = _storage._changedCompanyID { + try { if let v = _storage._changedCompanyID { try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } + } }() if _storage._country != 0 { try visitor.visitSingularInt32Field(value: _storage._country, fieldNumber: 5) } - if let v = _storage._createdAt { + try { if let v = _storage._createdAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - } + } }() if !_storage._description_p.isEmpty { try visitor.visitSingularStringField(value: _storage._description_p, fieldNumber: 7) } if !_storage._developed.isEmpty { try visitor.visitRepeatedMessageField(value: _storage._developed, fieldNumber: 8) } - if let v = _storage._logo { + try { if let v = _storage._logo { try visitor.visitSingularMessageField(value: v, fieldNumber: 9) - } + } }() if !_storage._name.isEmpty { try visitor.visitSingularStringField(value: _storage._name, fieldNumber: 10) } - if let v = _storage._parent { + try { if let v = _storage._parent { try visitor.visitSingularMessageField(value: v, fieldNumber: 11) - } + } }() if !_storage._published.isEmpty { try visitor.visitRepeatedMessageField(value: _storage._published, fieldNumber: 12) } if !_storage._slug.isEmpty { try visitor.visitSingularStringField(value: _storage._slug, fieldNumber: 13) } - if let v = _storage._startDate { + try { if let v = _storage._startDate { try visitor.visitSingularMessageField(value: v, fieldNumber: 14) - } + } }() if _storage._startDateCategory != .yyyymmmmdd { try visitor.visitSingularEnumField(value: _storage._startDateCategory, fieldNumber: 15) } - if let v = _storage._updatedAt { + try { if let v = _storage._updatedAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 16) - } + } }() if !_storage._url.isEmpty { try visitor.visitSingularStringField(value: _storage._url, fieldNumber: 17) } @@ -5339,6 +5554,10 @@ extension Proto_Cover: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementati public func traverse(visitor: inout V) throws { try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if _storage._id != 0 { try visitor.visitSingularUInt64Field(value: _storage._id, fieldNumber: 1) } @@ -5348,9 +5567,9 @@ extension Proto_Cover: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementati if _storage._animated != false { try visitor.visitSingularBoolField(value: _storage._animated, fieldNumber: 3) } - if let v = _storage._game { + try { if let v = _storage._game { try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } + } }() if _storage._height != 0 { try visitor.visitSingularInt32Field(value: _storage._height, fieldNumber: 5) } @@ -5468,27 +5687,31 @@ extension Proto_ExternalGame: SwiftProtobuf.Message, SwiftProtobuf._MessageImple } public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if self.id != 0 { try visitor.visitSingularUInt64Field(value: self.id, fieldNumber: 1) } if self.category != .externalgameCategoryNull { try visitor.visitSingularEnumField(value: self.category, fieldNumber: 2) } - if let v = self._createdAt { + try { if let v = self._createdAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } - if let v = self._game { + } }() + try { if let v = self._game { try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } + } }() if !self.name.isEmpty { try visitor.visitSingularStringField(value: self.name, fieldNumber: 5) } if !self.uid.isEmpty { try visitor.visitSingularStringField(value: self.uid, fieldNumber: 6) } - if let v = self._updatedAt { + try { if let v = self._updatedAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - } + } }() if !self.url.isEmpty { try visitor.visitSingularStringField(value: self.url, fieldNumber: 8) } @@ -5498,9 +5721,9 @@ extension Proto_ExternalGame: SwiftProtobuf.Message, SwiftProtobuf._MessageImple if self.media != .externalgameMediaNull { try visitor.visitSingularEnumField(value: self.media, fieldNumber: 10) } - if let v = self._platform { + try { if let v = self._platform { try visitor.visitSingularMessageField(value: v, fieldNumber: 11) - } + } }() if !self.countries.isEmpty { try visitor.visitPackedInt32Field(value: self.countries, fieldNumber: 12) } @@ -5594,12 +5817,16 @@ extension Proto_Franchise: SwiftProtobuf.Message, SwiftProtobuf._MessageImplemen } public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if self.id != 0 { try visitor.visitSingularUInt64Field(value: self.id, fieldNumber: 1) } - if let v = self._createdAt { + try { if let v = self._createdAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } + } }() if !self.games.isEmpty { try visitor.visitRepeatedMessageField(value: self.games, fieldNumber: 3) } @@ -5609,9 +5836,9 @@ extension Proto_Franchise: SwiftProtobuf.Message, SwiftProtobuf._MessageImplemen if !self.slug.isEmpty { try visitor.visitSingularStringField(value: self.slug, fieldNumber: 5) } - if let v = self._updatedAt { + try { if let v = self._updatedAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - } + } }() if !self.url.isEmpty { try visitor.visitSingularStringField(value: self.url, fieldNumber: 7) } @@ -5925,6 +6152,10 @@ extension Proto_Game: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementatio public func traverse(visitor: inout V) throws { try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if _storage._id != 0 { try visitor.visitSingularUInt64Field(value: _storage._id, fieldNumber: 1) } @@ -5949,15 +6180,15 @@ extension Proto_Game: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementatio if _storage._category != .mainGame { try visitor.visitSingularEnumField(value: _storage._category, fieldNumber: 8) } - if let v = _storage._collection { + try { if let v = _storage._collection { try visitor.visitSingularMessageField(value: v, fieldNumber: 9) - } - if let v = _storage._cover { + } }() + try { if let v = _storage._cover { try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } - if let v = _storage._createdAt { + } }() + try { if let v = _storage._createdAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 11) - } + } }() if !_storage._dlcs.isEmpty { try visitor.visitRepeatedMessageField(value: _storage._dlcs, fieldNumber: 12) } @@ -5967,15 +6198,15 @@ extension Proto_Game: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementatio if !_storage._externalGames.isEmpty { try visitor.visitRepeatedMessageField(value: _storage._externalGames, fieldNumber: 14) } - if let v = _storage._firstReleaseDate { + try { if let v = _storage._firstReleaseDate { try visitor.visitSingularMessageField(value: v, fieldNumber: 15) - } + } }() if _storage._follows != 0 { try visitor.visitSingularInt32Field(value: _storage._follows, fieldNumber: 16) } - if let v = _storage._franchise { + try { if let v = _storage._franchise { try visitor.visitSingularMessageField(value: v, fieldNumber: 17) - } + } }() if !_storage._franchises.isEmpty { try visitor.visitRepeatedMessageField(value: _storage._franchises, fieldNumber: 18) } @@ -6003,9 +6234,9 @@ extension Proto_Game: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementatio if !_storage._name.isEmpty { try visitor.visitSingularStringField(value: _storage._name, fieldNumber: 26) } - if let v = _storage._parentGame { + try { if let v = _storage._parentGame { try visitor.visitSingularMessageField(value: v, fieldNumber: 27) - } + } }() if !_storage._platforms.isEmpty { try visitor.visitRepeatedMessageField(value: _storage._platforms, fieldNumber: 28) } @@ -6054,15 +6285,15 @@ extension Proto_Game: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementatio if _storage._totalRatingCount != 0 { try visitor.visitSingularInt32Field(value: _storage._totalRatingCount, fieldNumber: 43) } - if let v = _storage._updatedAt { + try { if let v = _storage._updatedAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 44) - } + } }() if !_storage._url.isEmpty { try visitor.visitSingularStringField(value: _storage._url, fieldNumber: 45) } - if let v = _storage._versionParent { + try { if let v = _storage._versionParent { try visitor.visitSingularMessageField(value: v, fieldNumber: 46) - } + } }() if !_storage._versionTitle.isEmpty { try visitor.visitSingularStringField(value: _storage._versionTitle, fieldNumber: 47) } @@ -6277,21 +6508,25 @@ extension Proto_GameEngine: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme public func traverse(visitor: inout V) throws { try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if _storage._id != 0 { try visitor.visitSingularUInt64Field(value: _storage._id, fieldNumber: 1) } if !_storage._companies.isEmpty { try visitor.visitRepeatedMessageField(value: _storage._companies, fieldNumber: 2) } - if let v = _storage._createdAt { + try { if let v = _storage._createdAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } + } }() if !_storage._description_p.isEmpty { try visitor.visitSingularStringField(value: _storage._description_p, fieldNumber: 4) } - if let v = _storage._logo { + try { if let v = _storage._logo { try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } + } }() if !_storage._name.isEmpty { try visitor.visitSingularStringField(value: _storage._name, fieldNumber: 6) } @@ -6301,9 +6536,9 @@ extension Proto_GameEngine: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme if !_storage._slug.isEmpty { try visitor.visitSingularStringField(value: _storage._slug, fieldNumber: 8) } - if let v = _storage._updatedAt { + try { if let v = _storage._updatedAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 9) - } + } }() if !_storage._url.isEmpty { try visitor.visitSingularStringField(value: _storage._url, fieldNumber: 10) } @@ -6508,21 +6743,25 @@ extension Proto_GameMode: SwiftProtobuf.Message, SwiftProtobuf._MessageImplement } public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if self.id != 0 { try visitor.visitSingularUInt64Field(value: self.id, fieldNumber: 1) } - if let v = self._createdAt { + try { if let v = self._createdAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } + } }() if !self.name.isEmpty { try visitor.visitSingularStringField(value: self.name, fieldNumber: 3) } if !self.slug.isEmpty { try visitor.visitSingularStringField(value: self.slug, fieldNumber: 4) } - if let v = self._updatedAt { + try { if let v = self._updatedAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } + } }() if !self.url.isEmpty { try visitor.visitSingularStringField(value: self.url, fieldNumber: 6) } @@ -6610,24 +6849,28 @@ extension Proto_GameVersion: SwiftProtobuf.Message, SwiftProtobuf._MessageImplem } public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if self.id != 0 { try visitor.visitSingularUInt64Field(value: self.id, fieldNumber: 1) } - if let v = self._createdAt { + try { if let v = self._createdAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } + } }() if !self.features.isEmpty { try visitor.visitRepeatedMessageField(value: self.features, fieldNumber: 3) } - if let v = self._game { + try { if let v = self._game { try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } + } }() if !self.games.isEmpty { try visitor.visitRepeatedMessageField(value: self.games, fieldNumber: 5) } - if let v = self._updatedAt { + try { if let v = self._updatedAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - } + } }() if !self.url.isEmpty { try visitor.visitSingularStringField(value: self.url, fieldNumber: 7) } @@ -6812,15 +7055,19 @@ extension Proto_GameVersionFeatureValue: SwiftProtobuf.Message, SwiftProtobuf._M } public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if self.id != 0 { try visitor.visitSingularUInt64Field(value: self.id, fieldNumber: 1) } - if let v = self._game { + try { if let v = self._game { try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } - if let v = self._gameFeature { + } }() + try { if let v = self._gameFeature { try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } + } }() if self.includedFeature != .notIncluded { try visitor.visitSingularEnumField(value: self.includedFeature, fieldNumber: 4) } @@ -6904,12 +7151,16 @@ extension Proto_GameVideo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplemen } public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if self.id != 0 { try visitor.visitSingularUInt64Field(value: self.id, fieldNumber: 1) } - if let v = self._game { + try { if let v = self._game { try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } + } }() if !self.name.isEmpty { try visitor.visitSingularStringField(value: self.name, fieldNumber: 3) } @@ -6996,21 +7247,25 @@ extension Proto_Genre: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementati } public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if self.id != 0 { try visitor.visitSingularUInt64Field(value: self.id, fieldNumber: 1) } - if let v = self._createdAt { + try { if let v = self._createdAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } + } }() if !self.name.isEmpty { try visitor.visitSingularStringField(value: self.name, fieldNumber: 3) } if !self.slug.isEmpty { try visitor.visitSingularStringField(value: self.slug, fieldNumber: 4) } - if let v = self._updatedAt { + try { if let v = self._updatedAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } + } }() if !self.url.isEmpty { try visitor.visitSingularStringField(value: self.url, fieldNumber: 6) } @@ -7102,21 +7357,25 @@ extension Proto_InvolvedCompany: SwiftProtobuf.Message, SwiftProtobuf._MessageIm } public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if self.id != 0 { try visitor.visitSingularUInt64Field(value: self.id, fieldNumber: 1) } - if let v = self._company { + try { if let v = self._company { try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } - if let v = self._createdAt { + } }() + try { if let v = self._createdAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } + } }() if self.developer != false { try visitor.visitSingularBoolField(value: self.developer, fieldNumber: 4) } - if let v = self._game { + try { if let v = self._game { try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } + } }() if self.porting != false { try visitor.visitSingularBoolField(value: self.porting, fieldNumber: 6) } @@ -7126,9 +7385,9 @@ extension Proto_InvolvedCompany: SwiftProtobuf.Message, SwiftProtobuf._MessageIm if self.supporting != false { try visitor.visitSingularBoolField(value: self.supporting, fieldNumber: 8) } - if let v = self._updatedAt { + try { if let v = self._updatedAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 9) - } + } }() if !self.checksum.isEmpty { try visitor.visitSingularStringField(value: self.checksum, fieldNumber: 10) } @@ -7214,21 +7473,25 @@ extension Proto_Keyword: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementa } public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if self.id != 0 { try visitor.visitSingularUInt64Field(value: self.id, fieldNumber: 1) } - if let v = self._createdAt { + try { if let v = self._createdAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } + } }() if !self.name.isEmpty { try visitor.visitSingularStringField(value: self.name, fieldNumber: 3) } if !self.slug.isEmpty { try visitor.visitSingularStringField(value: self.slug, fieldNumber: 4) } - if let v = self._updatedAt { + try { if let v = self._updatedAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } + } }() if !self.url.isEmpty { try visitor.visitSingularStringField(value: self.url, fieldNumber: 6) } @@ -7330,6 +7593,10 @@ extension Proto_MultiplayerMode: SwiftProtobuf.Message, SwiftProtobuf._MessageIm } public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if self.id != 0 { try visitor.visitSingularUInt64Field(value: self.id, fieldNumber: 1) } @@ -7339,9 +7606,9 @@ extension Proto_MultiplayerMode: SwiftProtobuf.Message, SwiftProtobuf._MessageIm if self.dropin != false { try visitor.visitSingularBoolField(value: self.dropin, fieldNumber: 3) } - if let v = self._game { + try { if let v = self._game { try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } + } }() if self.lancoop != false { try visitor.visitSingularBoolField(value: self.lancoop, fieldNumber: 5) } @@ -7363,9 +7630,9 @@ extension Proto_MultiplayerMode: SwiftProtobuf.Message, SwiftProtobuf._MessageIm if self.onlinemax != 0 { try visitor.visitSingularInt32Field(value: self.onlinemax, fieldNumber: 11) } - if let v = self._platform { + try { if let v = self._platform { try visitor.visitSingularMessageField(value: v, fieldNumber: 12) - } + } }() if self.splitscreen != false { try visitor.visitSingularBoolField(value: self.splitscreen, fieldNumber: 13) } @@ -7533,6 +7800,10 @@ extension Proto_Platform: SwiftProtobuf.Message, SwiftProtobuf._MessageImplement public func traverse(visitor: inout V) throws { try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if _storage._id != 0 { try visitor.visitSingularUInt64Field(value: _storage._id, fieldNumber: 1) } @@ -7545,30 +7816,30 @@ extension Proto_Platform: SwiftProtobuf.Message, SwiftProtobuf._MessageImplement if _storage._category != .platformCategoryNull { try visitor.visitSingularEnumField(value: _storage._category, fieldNumber: 4) } - if let v = _storage._createdAt { + try { if let v = _storage._createdAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } + } }() if _storage._generation != 0 { try visitor.visitSingularInt32Field(value: _storage._generation, fieldNumber: 6) } if !_storage._name.isEmpty { try visitor.visitSingularStringField(value: _storage._name, fieldNumber: 7) } - if let v = _storage._platformLogo { + try { if let v = _storage._platformLogo { try visitor.visitSingularMessageField(value: v, fieldNumber: 8) - } - if let v = _storage._platformFamily { + } }() + try { if let v = _storage._platformFamily { try visitor.visitSingularMessageField(value: v, fieldNumber: 9) - } + } }() if !_storage._slug.isEmpty { try visitor.visitSingularStringField(value: _storage._slug, fieldNumber: 10) } if !_storage._summary.isEmpty { try visitor.visitSingularStringField(value: _storage._summary, fieldNumber: 11) } - if let v = _storage._updatedAt { + try { if let v = _storage._updatedAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 12) - } + } }() if !_storage._url.isEmpty { try visitor.visitSingularStringField(value: _storage._url, fieldNumber: 13) } @@ -7957,6 +8228,10 @@ extension Proto_PlatformVersion: SwiftProtobuf.Message, SwiftProtobuf._MessageIm public func traverse(visitor: inout V) throws { try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if _storage._id != 0 { try visitor.visitSingularUInt64Field(value: _storage._id, fieldNumber: 1) } @@ -7972,9 +8247,9 @@ extension Proto_PlatformVersion: SwiftProtobuf.Message, SwiftProtobuf._MessageIm if !_storage._graphics.isEmpty { try visitor.visitSingularStringField(value: _storage._graphics, fieldNumber: 5) } - if let v = _storage._mainManufacturer { + try { if let v = _storage._mainManufacturer { try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - } + } }() if !_storage._media.isEmpty { try visitor.visitSingularStringField(value: _storage._media, fieldNumber: 7) } @@ -7993,9 +8268,9 @@ extension Proto_PlatformVersion: SwiftProtobuf.Message, SwiftProtobuf._MessageIm if !_storage._output.isEmpty { try visitor.visitSingularStringField(value: _storage._output, fieldNumber: 12) } - if let v = _storage._platformLogo { + try { if let v = _storage._platformLogo { try visitor.visitSingularMessageField(value: v, fieldNumber: 13) - } + } }() if !_storage._platformVersionReleaseDates.isEmpty { try visitor.visitRepeatedMessageField(value: _storage._platformVersionReleaseDates, fieldNumber: 14) } @@ -8120,15 +8395,19 @@ extension Proto_PlatformVersionCompany: SwiftProtobuf.Message, SwiftProtobuf._Me } public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if self.id != 0 { try visitor.visitSingularUInt64Field(value: self.id, fieldNumber: 1) } if !self.comment.isEmpty { try visitor.visitSingularStringField(value: self.comment, fieldNumber: 2) } - if let v = self._company { + try { if let v = self._company { try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } + } }() if self.developer != false { try visitor.visitSingularBoolField(value: self.developer, fieldNumber: 4) } @@ -8224,33 +8503,37 @@ extension Proto_PlatformVersionReleaseDate: SwiftProtobuf.Message, SwiftProtobuf } public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if self.id != 0 { try visitor.visitSingularUInt64Field(value: self.id, fieldNumber: 1) } if self.category != .yyyymmmmdd { try visitor.visitSingularEnumField(value: self.category, fieldNumber: 2) } - if let v = self._createdAt { + try { if let v = self._createdAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } - if let v = self._date { + } }() + try { if let v = self._date { try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } + } }() if !self.human.isEmpty { try visitor.visitSingularStringField(value: self.human, fieldNumber: 5) } if self.m != 0 { try visitor.visitSingularInt32Field(value: self.m, fieldNumber: 6) } - if let v = self._platformVersion { + try { if let v = self._platformVersion { try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - } + } }() if self.region != .regionRegionNull { try visitor.visitSingularEnumField(value: self.region, fieldNumber: 8) } - if let v = self._updatedAt { + try { if let v = self._updatedAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 9) - } + } }() if self.y != 0 { try visitor.visitSingularInt32Field(value: self.y, fieldNumber: 10) } @@ -8428,21 +8711,25 @@ extension Proto_PlayerPerspective: SwiftProtobuf.Message, SwiftProtobuf._Message } public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if self.id != 0 { try visitor.visitSingularUInt64Field(value: self.id, fieldNumber: 1) } - if let v = self._createdAt { + try { if let v = self._createdAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } + } }() if !self.name.isEmpty { try visitor.visitSingularStringField(value: self.name, fieldNumber: 3) } if !self.slug.isEmpty { try visitor.visitSingularStringField(value: self.slug, fieldNumber: 4) } - if let v = self._updatedAt { + try { if let v = self._updatedAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } + } }() if !self.url.isEmpty { try visitor.visitSingularStringField(value: self.url, fieldNumber: 6) } @@ -8538,36 +8825,40 @@ extension Proto_ReleaseDate: SwiftProtobuf.Message, SwiftProtobuf._MessageImplem } public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if self.id != 0 { try visitor.visitSingularUInt64Field(value: self.id, fieldNumber: 1) } if self.category != .yyyymmmmdd { try visitor.visitSingularEnumField(value: self.category, fieldNumber: 2) } - if let v = self._createdAt { + try { if let v = self._createdAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } - if let v = self._date { + } }() + try { if let v = self._date { try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } - if let v = self._game { + } }() + try { if let v = self._game { try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } + } }() if !self.human.isEmpty { try visitor.visitSingularStringField(value: self.human, fieldNumber: 6) } if self.m != 0 { try visitor.visitSingularInt32Field(value: self.m, fieldNumber: 7) } - if let v = self._platform { + try { if let v = self._platform { try visitor.visitSingularMessageField(value: v, fieldNumber: 8) - } + } }() if self.region != .regionRegionNull { try visitor.visitSingularEnumField(value: self.region, fieldNumber: 9) } - if let v = self._updatedAt { + try { if let v = self._updatedAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } + } }() if self.y != 0 { try visitor.visitSingularInt32Field(value: self.y, fieldNumber: 11) } @@ -8662,6 +8953,10 @@ extension Proto_Screenshot: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme } public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if self.id != 0 { try visitor.visitSingularUInt64Field(value: self.id, fieldNumber: 1) } @@ -8671,9 +8966,9 @@ extension Proto_Screenshot: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme if self.animated != false { try visitor.visitSingularBoolField(value: self.animated, fieldNumber: 3) } - if let v = self._game { + try { if let v = self._game { try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } + } }() if self.height != 0 { try visitor.visitSingularInt32Field(value: self.height, fieldNumber: 5) } @@ -8829,42 +9124,46 @@ extension Proto_Search: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementat public func traverse(visitor: inout V) throws { try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if _storage._id != 0 { try visitor.visitSingularUInt64Field(value: _storage._id, fieldNumber: 1) } if !_storage._alternativeName.isEmpty { try visitor.visitSingularStringField(value: _storage._alternativeName, fieldNumber: 2) } - if let v = _storage._character { + try { if let v = _storage._character { try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } - if let v = _storage._collection { + } }() + try { if let v = _storage._collection { try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } - if let v = _storage._company { + } }() + try { if let v = _storage._company { try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } + } }() if !_storage._description_p.isEmpty { try visitor.visitSingularStringField(value: _storage._description_p, fieldNumber: 6) } - if let v = _storage._game { + try { if let v = _storage._game { try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - } + } }() if !_storage._name.isEmpty { try visitor.visitSingularStringField(value: _storage._name, fieldNumber: 8) } - if let v = _storage._platform { + try { if let v = _storage._platform { try visitor.visitSingularMessageField(value: v, fieldNumber: 9) - } - if let v = _storage._publishedAt { + } }() + try { if let v = _storage._publishedAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } - if let v = _storage._testDummy { + } }() + try { if let v = _storage._testDummy { try visitor.visitSingularMessageField(value: v, fieldNumber: 11) - } - if let v = _storage._theme { + } }() + try { if let v = _storage._theme { try visitor.visitSingularMessageField(value: v, fieldNumber: 12) - } + } }() if !_storage._checksum.isEmpty { try visitor.visitSingularStringField(value: _storage._checksum, fieldNumber: 13) } @@ -9041,24 +9340,28 @@ extension Proto_TestDummy: SwiftProtobuf.Message, SwiftProtobuf._MessageImplemen public func traverse(visitor: inout V) throws { try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if _storage._id != 0 { try visitor.visitSingularUInt64Field(value: _storage._id, fieldNumber: 1) } if _storage._boolValue != false { try visitor.visitSingularBoolField(value: _storage._boolValue, fieldNumber: 2) } - if let v = _storage._createdAt { + try { if let v = _storage._createdAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } + } }() if _storage._enumTest != .testdummyEnumTestNull { try visitor.visitSingularEnumField(value: _storage._enumTest, fieldNumber: 4) } if _storage._floatValue != 0 { try visitor.visitSingularDoubleField(value: _storage._floatValue, fieldNumber: 5) } - if let v = _storage._game { + try { if let v = _storage._game { try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - } + } }() if !_storage._integerArray.isEmpty { try visitor.visitPackedInt32Field(value: _storage._integerArray, fieldNumber: 7) } @@ -9083,12 +9386,12 @@ extension Proto_TestDummy: SwiftProtobuf.Message, SwiftProtobuf._MessageImplemen if !_storage._testDummies.isEmpty { try visitor.visitRepeatedMessageField(value: _storage._testDummies, fieldNumber: 14) } - if let v = _storage._testDummy { + try { if let v = _storage._testDummy { try visitor.visitSingularMessageField(value: v, fieldNumber: 15) - } - if let v = _storage._updatedAt { + } }() + try { if let v = _storage._updatedAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 16) - } + } }() if !_storage._url.isEmpty { try visitor.visitSingularStringField(value: _storage._url, fieldNumber: 17) } @@ -9194,21 +9497,25 @@ extension Proto_Theme: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementati } public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if self.id != 0 { try visitor.visitSingularUInt64Field(value: self.id, fieldNumber: 1) } - if let v = self._createdAt { + try { if let v = self._createdAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } + } }() if !self.name.isEmpty { try visitor.visitSingularStringField(value: self.name, fieldNumber: 3) } if !self.slug.isEmpty { try visitor.visitSingularStringField(value: self.slug, fieldNumber: 4) } - if let v = self._updatedAt { + try { if let v = self._updatedAt { try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } + } }() if !self.url.isEmpty { try visitor.visitSingularStringField(value: self.url, fieldNumber: 6) } @@ -9292,15 +9599,19 @@ extension Proto_Website: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementa } public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if self.id != 0 { try visitor.visitSingularUInt64Field(value: self.id, fieldNumber: 1) } if self.category != .websiteCategoryNull { try visitor.visitSingularEnumField(value: self.category, fieldNumber: 2) } - if let v = self._game { + try { if let v = self._game { try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } + } }() if self.trusted != false { try visitor.visitSingularBoolField(value: self.trusted, fieldNumber: 4) } diff --git a/Sources/IGDB-SWIFT-API/Wrapper/IGDBWrapper.swift b/Sources/IGDB-SWIFT-API/Wrapper/IGDBWrapper.swift index d33affa..fa5c0db 100644 --- a/Sources/IGDB-SWIFT-API/Wrapper/IGDBWrapper.swift +++ b/Sources/IGDB-SWIFT-API/Wrapper/IGDBWrapper.swift @@ -19,45 +19,45 @@ public class IGDBWrapper { public func apiProtoRequest(endpoint: Endpoint, apicalypseQuery: String, dataResponse: @escaping (Data) -> (Void), errorResponse: @escaping (RequestException) -> (Void)) { let requestURL = "\(APIURL)\(endpoint.url()).pb" - Just.post(requestURL, headers: requestHeaders, requestBody: apicalypseQuery.data(using: .utf8, allowLossyConversion: false)) { response in + Just.post(requestURL, headers: requestHeaders, requestBody: apicalypseQuery.data(using: .utf8, allowLossyConversion: false), asyncCompletionHandler: { response in if response.statusCode != 200 { errorResponse(RequestException(statusCode: response.statusCode ?? -1, url: requestURL, msg: response.text ?? "")) } dataResponse(response.content!) - } + }) } public func apiJsonRequest(endpoint: Endpoint, apicalypseQuery: String, dataResponse: @escaping (String) -> (Void), errorResponse: @escaping (RequestException) -> (Void)) { let requestURL = "\(APIURL)\(endpoint.url())" - Just.post(requestURL, headers: requestHeaders, requestBody: apicalypseQuery.data(using: .utf8, allowLossyConversion: false)) { response in + Just.post(requestURL, headers: requestHeaders, requestBody: apicalypseQuery.data(using: .utf8, allowLossyConversion: false), asyncCompletionHandler: { response in if response.statusCode != 200 { errorResponse(RequestException(statusCode: response.statusCode ?? -1, url: requestURL, msg: response.text ?? "")) } dataResponse(response.text ?? "") - } + }) } // Adding count functions public func apiProtoCountRequest(endpoint: Endpoint, apicalypseQuery: String, dataResponse: @escaping (Data) -> (Void), errorResponse: @escaping (RequestException) -> (Void)) { let requestURL = "\(APIURL)\(endpoint.url())/count.pb" - Just.post(requestURL, headers: requestHeaders, requestBody: apicalypseQuery.data(using: .utf8, allowLossyConversion: false)) { response in + Just.post(requestURL, headers: requestHeaders, requestBody: apicalypseQuery.data(using: .utf8, allowLossyConversion: false), asyncCompletionHandler: { response in if response.statusCode != 200 { errorResponse(RequestException(statusCode: response.statusCode ?? -1, url: requestURL, msg: response.text ?? "")) } dataResponse(response.content!) - } + }) } public func apiJsonCountRequest(endpoint: Endpoint, apicalypseQuery: String, dataResponse: @escaping (String) -> (Void), errorResponse: @escaping (RequestException) -> (Void)) { let requestURL = "\(APIURL)\(endpoint.url())/count" - Just.post(requestURL, headers: requestHeaders, requestBody: apicalypseQuery.data(using: .utf8, allowLossyConversion: false)) { response in + Just.post(requestURL, headers: requestHeaders, requestBody: apicalypseQuery.data(using: .utf8, allowLossyConversion: false), asyncCompletionHandler: { response in if response.statusCode != 200 { errorResponse(RequestException(statusCode: response.statusCode ?? -1, url: requestURL, msg: response.text ?? "")) } dataResponse(response.text ?? "") - } + }) } }