Skip to content

Commit

Permalink
Merge pull request #2 from romanmazeev/concurrency-fixes
Browse files Browse the repository at this point in the history
FIx concurrency warnings
  • Loading branch information
romanmazeev authored Jun 27, 2024
2 parents 05628bf + dfc3ea5 commit f6a0b10
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 22 deletions.
8 changes: 4 additions & 4 deletions Sources/MRZParser/Public/MRZResult.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public enum MRZFormat: CaseIterable {
public enum MRZFormat: Sendable, CaseIterable {
case td1, td2, td3

public var lineLength: Int {
Expand All @@ -31,8 +31,8 @@ public enum MRZFormat: CaseIterable {
}
}

public struct MRZResult {
public enum DocumentType: CaseIterable {
public struct MRZResult: Sendable, Hashable {
public enum DocumentType: Sendable, CaseIterable {
case visa
case passport
case id
Expand All @@ -52,7 +52,7 @@ public struct MRZResult {
}
}

public enum Sex: CaseIterable {
public enum Sex: Sendable, CaseIterable {
case male
case female
case unspecified
Expand Down
18 changes: 0 additions & 18 deletions Tests/MRZParserIntegrationTests/MRZParserIntegrationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -217,21 +217,3 @@ final class MRZParserTests: XCTestCase {
XCTAssertEqual(parser.parse(mrzString: mrzString), result)
}
}

extension MRZResult: Equatable {
public static func == (lhs: MRZResult, rhs: MRZResult) -> Bool {
lhs.format == rhs.format &&
lhs.documentType == rhs.documentType &&
lhs.documentTypeAdditional == rhs.documentTypeAdditional &&
lhs.countryCode == rhs.countryCode &&
lhs.surnames == rhs.surnames &&
lhs.givenNames == rhs.givenNames &&
lhs.documentNumber == rhs.documentNumber &&
lhs.nationalityCountryCode == rhs.nationalityCountryCode &&
lhs.birthdate == rhs.birthdate &&
lhs.sex == rhs.sex &&
lhs.expiryDate == rhs.expiryDate &&
lhs.optionalData == rhs.optionalData &&
lhs.optionalData2 == rhs.optionalData2
}
}

0 comments on commit f6a0b10

Please sign in to comment.