Skip to content

Commit

Permalink
Removes unneeded wildcard from Platforms in Availability
Browse files Browse the repository at this point in the history
  • Loading branch information
mustiikhalil committed Apr 4, 2024
1 parent 57141c6 commit c9d5867
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions Sources/SwiftDocC/Semantics/Metadata/Availability.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ extension Metadata {
public static let introducedVersion = "5.8"

public enum Platform: RawRepresentable, Hashable, DirectiveArgumentValueConvertible {
case macOS, iOS, watchOS, tvOS, any
case macOS, iOS, watchOS, tvOS

case other(String)

Expand All @@ -63,11 +63,7 @@ extension Metadata {
return
}
}
if rawValue == "*" {
self = .any
} else {
self = .other(rawValue)
}
self = .other(rawValue)
}

public var rawValue: String {
Expand All @@ -76,7 +72,6 @@ extension Metadata {
case .iOS: return "iOS"
case .watchOS: return "watchOS"
case .tvOS: return "tvOS"
case .any: return "*"
case .other(let platform): return platform
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class MetadataAvailabilityTests: XCTestCase {
@Available(macOS, introduced: "11.0")
@Available(iOS, introduced: "15.0")
@Available(watchOS, introduced: "7.0", deprecated: "9.0")
@Available(*, introduced: "0.1", deprecated: "1.0")
@Available("My Package", introduced: "0.1", deprecated: "1.0")
}
"""
try assertValidMetadata(source: source)
Expand Down

0 comments on commit c9d5867

Please sign in to comment.