Skip to content

Commit

Permalink
fix: compiler errors for older swift versions
Browse files Browse the repository at this point in the history
  • Loading branch information
mflknr committed Apr 27, 2024
1 parent 4066cad commit c675e3f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .swiftformat
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@
--enable noExplicitOwnership
--enable wrapConditionalBodies
--enable wrapEnumCases
--enable wrapMultilineConditionalAssignment
--enable wrapMultilineConditionalAssignment
--disable preferKeyPath
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,14 @@ public extension SemanticVersionComparable {
/// The pre-release identifier as a string if available.
var prereleaseIdentifierString: String? {
prerelease?
.compactMap(\.value)
.compactMap { $0.value }
.joined(separator: ".")
}

/// The build-meta-data as a string if available.
var buildMetaDataString: String? {
build?
.compactMap(\.value)
.compactMap { $0.value }
.joined(separator: ".")
}
}
4 changes: 1 addition & 3 deletions Sources/Version.swift
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,7 @@ public struct Version: Sendable, SemanticVersionComparable {
build = String(buildSubstring)
.split(separator: ".")
.map(String.init)
.compactMap {
BuildMetaData($0)
}
.compactMap { BuildMetaData($0) }
// finding an .unkown element means that the given string is not conform to `SemVer` since it is no
// alphaNumeric or a digit
if
Expand Down

0 comments on commit c675e3f

Please sign in to comment.