Fix lint issues.

This commit is contained in:
Brent Simmons
2025-01-25 10:25:26 -08:00
parent 7e4fac6cae
commit fd84481129
3 changed files with 9 additions and 12 deletions

View File

@@ -117,11 +117,10 @@ private extension RSSInJSONParser {
}
if s.isEmpty {
// Sheesh. Tough case.
if let _ = contentHTML {
s = contentHTML!
}
if let _ = contentText {
s = contentText!
if let contentHTML {
s = contentHTML
} else if let contentText {
s = contentText
}
}
uniqueID = s.md5String

View File

@@ -28,10 +28,7 @@ public final class ParsedItem: Hashable, Sendable {
public let tags: Set<String>?
public let attachments: Set<ParsedAttachment>?
public init(syncServiceID: String?, uniqueID: String, feedURL: String, url: String?, externalURL: String?, title: String?,
language: String?, contentHTML: String?, contentText: String?, summary: String?, imageURL: String?,
bannerImageURL: String?, datePublished: Date?, dateModified: Date?, authors: Set<ParsedAuthor>?,
tags: Set<String>?, attachments: Set<ParsedAttachment>?) {
public init(syncServiceID: String?, uniqueID: String, feedURL: String, url: String?, externalURL: String?, title: String?, language: String?, contentHTML: String?, contentText: String?, summary: String?, imageURL: String?, bannerImageURL: String?, datePublished: Date?, dateModified: Date?, authors: Set<ParsedAuthor>?, tags: Set<String>?, attachments: Set<ParsedAttachment>?) {
self.syncServiceID = syncServiceID
self.uniqueID = uniqueID

View File

@@ -131,9 +131,10 @@ private func decodedRawEntityValue(_ rawEntity: ContiguousArray<UInt8>) -> Strin
entityCharacters.append(character)
}
let key = String(decoding: entityCharacters, as: UTF8.self)
if let entityString = entitiesDictionary[key] {
return entityString
if let key = String(bytes: entityCharacters, encoding: .utf8) {
if let entityString = entitiesDictionary[key] {
return entityString
}
}
if rawEntity[0] == numberSignCharacter {