Skip to content

Resolve a few recently introduced warnings #1103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Sources/SwiftDocC/Infrastructure/DocumentationContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public class DocumentationContext {
case .legacy(let legacyDataProvider):
return try legacyDataProvider.contentsOfURL(url, in: bundle)
case .new(let dataProvider):
assert(self.bundle?.identifier == bundle.identifier, "New code shouldn't pass unknown bundle identifiers to 'DocumentationContext.bundle(identifier:)'.")
assert(self.bundle?.id == bundle.id, "New code shouldn't pass unknown bundle identifiers to 'DocumentationContext.bundle(identifier:)'.")
return try dataProvider.contents(of: url)
}
}
Expand Down Expand Up @@ -392,7 +392,7 @@ public class DocumentationContext {
case .legacy(let legacyDataProvider):
return legacyDataProvider.bundles[identifier]
case .new:
assert(bundle?.identifier == identifier, "New code shouldn't pass unknown bundle identifiers to 'DocumentationContext.bundle(identifier:)'.")
assert(bundle?.id.rawValue == identifier, "New code shouldn't pass unknown bundle identifiers to 'DocumentationContext.bundle(identifier:)'.")
return bundle?.id.rawValue == identifier ? bundle : nil
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
This source file is part of the Swift.org open source project

Copyright (c) 2021 Apple Inc. and the Swift project authors
Copyright (c) 2021-2024 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception

See https://swift.org/LICENSE.txt for license information
Expand All @@ -18,13 +18,13 @@ extension StringProtocol {
}

/// A copy of the string appended with a slash ("/") if the string doesn't already end with a trailing slash.
var appendingTrailingSlash: String {
package var appendingTrailingSlash: String {
guard !hasSuffix("/") else { return String(self) }
return self.appending("/")
}

/// A copy of the string without a leading slash ("/") or the original string if it doesn't start with a leading slash.
var removingLeadingSlash: String {
package var removingLeadingSlash: String {
guard hasPrefix("/") else { return String(self) }
return String(dropFirst())
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/SwiftDocCTestUtilities/TestFileSystem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import Foundation
import XCTest
@testable import SwiftDocC
import SwiftDocC

/// A Data provider and file manager that accepts pre-built documentation bundles with files on the local filesystem.
///
Expand Down Expand Up @@ -321,7 +321,7 @@ package class TestFileSystem: FileManagerProtocol {
case invalidPath(String)
var errorDescription: String {
switch self {
case .invalidPath(let path): return "Invalid path \(path.singleQuoted)"
case .invalidPath(let path): return "Invalid path '\(path)'"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ extension MergeAction {
renderNode.metadata.title = name
renderNode.metadata.roleHeading = roleHeading
renderNode.metadata.role = "collection"
renderNode.hierarchy = nil
renderNode.sections = []

if rootRenderReferences.containsBothKinds {
Expand Down