From 5afa8f19156fd66b5653b0cff0d5410b5395ba66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=80=E5=8D=93=E7=96=8C?= <55120045+WowbaggersLiquidLunch@users.noreply.github.com> Date: Fri, 27 May 2022 11:19:39 +0800 Subject: [PATCH] use the convenient computed property `isAllowedInSemanticVersionIdentifier` when validating build metadata MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: David Rönnqvist --- .../SymbolKit/SymbolGraph/SemanticVersion/SemanticVersion.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/SymbolKit/SymbolGraph/SemanticVersion/SemanticVersion.swift b/Sources/SymbolKit/SymbolGraph/SemanticVersion/SemanticVersion.swift index 5d3ad4e..0acc2b0 100644 --- a/Sources/SymbolKit/SymbolGraph/SemanticVersion/SemanticVersion.swift +++ b/Sources/SymbolKit/SymbolGraph/SemanticVersion/SemanticVersion.swift @@ -51,7 +51,7 @@ extension SymbolGraph { throw SymbolGraph.SemanticVersionError.emptyIdentifier(position: .buildMetadata) } try buildMetadataIdentifiers.forEach { - guard $0.allSatisfy( { $0.isASCII && ( $0.isLetter || $0.isNumber || $0 == "-" ) } ) else { + guard $0.allSatisfy( { $0.isAllowedInSemanticVersionIdentifier } ) else { throw SymbolGraph.SemanticVersionError.invalidCharacterInIdentifier($0, position: .buildMetadata) } }