Skip to content

Commit

Permalink
Support older Swift versions
Browse files Browse the repository at this point in the history
... `if let` shortcut doesn't work in older
Swift versions.
  • Loading branch information
helje5 committed Jun 6, 2024
1 parent 43c56d8 commit 24edd1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/DocCArchive/Schema_0_1/MetaData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ extension DocCArchive.DocCSchema_0_1 {

public var description: String {
var ms = "<Meta:"
if let role {
if let role = role {
ms += " \(role)"
}
if let s = roleHeading { ms += "(“\(s.rawValue)”)" }
Expand Down Expand Up @@ -228,7 +228,7 @@ extension DocCArchive.DocCSchema_0_1 {
try container.encode(categoryPathComponent,
forKey: .categoryPathComponent)

if let role {
if let role = role {
switch role { // TODO: move to Role type (singlevaluecontainer)
case .symbol(let kind):
try container.encode("symbol" , forKey: .role)
Expand Down

0 comments on commit 24edd1d

Please sign in to comment.