diff --git a/Sources/App/Core/Github.swift b/Sources/App/Core/Github.swift index b4bc2288c..be3d4c1e1 100644 --- a/Sources/App/Core/Github.swift +++ b/Sources/App/Core/Github.swift @@ -506,8 +506,8 @@ extension Github { { // Replace the image url and keep a copy of the old one in a `data` attribute let s3Key = try S3Store.Key.readme(owner: owner, repository: repository, imageUrl: src) - try imageElement.attr("src", s3Key.objectUrl) - try imageElement.attr("data-original-src", src) + _ = try imageElement.attr("src", s3Key.objectUrl) + _ = try imageElement.attr("data-original-src", src) imagesToCache.append(.init(originalUrl: src, s3Key: s3Key)) } } diff --git a/Sources/App/Views/DocumentationPageProcessor.swift b/Sources/App/Views/DocumentationPageProcessor.swift index c07d5d856..5f86d20f2 100644 --- a/Sources/App/Views/DocumentationPageProcessor.swift +++ b/Sources/App/Views/DocumentationPageProcessor.swift @@ -395,14 +395,14 @@ struct DocumentationPageProcessor { if !value.lowercased().hasPrefix("/\(owner)/\(repository)/".lowercased()) { // no /{owner}/{repo}/ prefix -> it's a dynamic base url resource, i.e. a "/" resource // / -> /a/b/~ (current) - try e.attr(attribute, "/\(owner)/\(repository)/\(String.current)\(value)".lowercased()) + _ = try e.attr(attribute, "/\(owner)/\(repository)/\(String.current)\(value)".lowercased()) } else if let reference { let fullyQualifiedPrefix = "/\(owner)/\(repository)/\(reference)".lowercased() if value.lowercased().hasPrefix(fullyQualifiedPrefix) { // matches expected fully qualified resource path // /a/b/1.2.3 -> /a/b/~ (current) let trimmed = value.dropFirst(fullyQualifiedPrefix.count) - try e.attr(attribute, "/\(owner)/\(repository)/\(String.current)\(trimmed)".lowercased()) + _ = try e.attr(attribute, "/\(owner)/\(repository)/\(String.current)\(trimmed)".lowercased()) } else { // did not match expected resource prefix - leave it alone // (shouldn't be possible) @@ -417,7 +417,7 @@ struct DocumentationPageProcessor { if !value.lowercased().hasPrefix("/\(owner)/\(repository)/".lowercased()) { // no /{owner}/{repo}/ prefix -> it's a dynamic base url resource, i.e. a "/" resource // / -> /a/b/~ (current) - try e.attr(attribute, "/\(owner)/\(repository)/\(reference)\(value)".lowercased()) + _ = try e.attr(attribute, "/\(owner)/\(repository)/\(reference)\(value)".lowercased()) } else { // already prefixed resource, leave it alone return diff --git a/Sources/App/Views/PackageController/PackageReadme+Model.swift b/Sources/App/Views/PackageController/PackageReadme+Model.swift index 315ca225b..bb576db10 100644 --- a/Sources/App/Views/PackageController/PackageReadme+Model.swift +++ b/Sources/App/Views/PackageController/PackageReadme+Model.swift @@ -84,7 +84,7 @@ extension Element { for imageElement in imageElements { if let imageUrl = URL(withPotentiallyUnencodedPath: try imageElement.attr("src")), let absoluteUrl = imageUrl.rewriteRelative(to: repoTriple, fileType: .raw) { - try imageElement.attr("src", absoluteUrl) + _ = try imageElement.attr("src", absoluteUrl) } } } catch { @@ -99,7 +99,7 @@ extension Element { for linkElement in linkElements { if let linkUrl = URL(withPotentiallyUnencodedPath: try linkElement.attr("href")), let absoluteUrl = linkUrl.rewriteRelative(to: repoTriple, fileType: .blob) { - try linkElement.attr("href", absoluteUrl) + _ = try linkElement.attr("href", absoluteUrl) } } } catch { @@ -116,7 +116,7 @@ extension Element { if linkDestination.hasPrefix("#") { // GitHub adds `user-content` to all anchor destinations but does not change // the anchors that link to the destinations or match the case that it uses. :rollseyes: - try linkElement.attr("href", "#user-content-\(linkDestination.dropFirst().lowercased())") + _ = try linkElement.attr("href", "#user-content-\(linkDestination.dropFirst().lowercased())") } } } catch { @@ -131,7 +131,7 @@ extension Element { for imageElement in imageElements { let originalUrl = try imageElement.attr("data-canonical-src") if originalUrl.hasPrefix("http") { - try imageElement.attr("src", originalUrl) + _ = try imageElement.attr("src", originalUrl) } } } catch { @@ -145,7 +145,7 @@ extension Element { let linkElements = try select("a") for linkElement in linkElements { // Disable Turbo on *all* link elements. - try linkElement.attr("data-turbo", "false") + _ = try linkElement.attr("data-turbo", "false") } } catch { // Errors are being intentionally eaten here. The worst that can happen if the