Fix lint issues.
This commit is contained in:
parent
aea89148ff
commit
03e9bbff34
@ -9,10 +9,10 @@ let package = Package(
|
|||||||
.library(
|
.library(
|
||||||
name: "Articles",
|
name: "Articles",
|
||||||
type: .dynamic,
|
type: .dynamic,
|
||||||
targets: ["Articles"]),
|
targets: ["Articles"])
|
||||||
],
|
],
|
||||||
dependencies: [
|
dependencies: [
|
||||||
.package(path: "../RSCore"),
|
.package(path: "../RSCore")
|
||||||
],
|
],
|
||||||
targets: [
|
targets: [
|
||||||
.target(
|
.target(
|
||||||
@ -21,6 +21,6 @@ let package = Package(
|
|||||||
"RSCore"
|
"RSCore"
|
||||||
],
|
],
|
||||||
swiftSettings: [.unsafeFlags(["-warnings-as-errors"])]
|
swiftSettings: [.unsafeFlags(["-warnings-as-errors"])]
|
||||||
),
|
)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
@ -46,8 +46,7 @@ public final class Article: Hashable {
|
|||||||
|
|
||||||
if let articleID = articleID {
|
if let articleID = articleID {
|
||||||
self.articleID = articleID
|
self.articleID = articleID
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
self.articleID = Article.calculatedArticleID(feedID: feedID, uniqueID: uniqueID)
|
self.articleID = Article.calculatedArticleID(feedID: feedID, uniqueID: uniqueID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -118,7 +117,7 @@ public extension Article {
|
|||||||
forHTML ? result.append("<\(tag)>") : result.append("<\(tag)>")
|
forHTML ? result.append("<\(tag)>") : result.append("<\(tag)>")
|
||||||
}
|
}
|
||||||
|
|
||||||
let _ = scanner.scanString(">")
|
_ = scanner.scanString(">")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,8 +27,7 @@ public struct Author: Codable, Hashable {
|
|||||||
|
|
||||||
if let authorID = authorID {
|
if let authorID = authorID {
|
||||||
self.authorID = authorID
|
self.authorID = authorID
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
var s = name ?? ""
|
var s = name ?? ""
|
||||||
s += url ?? ""
|
s += url ?? ""
|
||||||
s += avatarURL ?? ""
|
s += avatarURL ?? ""
|
||||||
@ -47,8 +46,7 @@ public struct Author: Codable, Hashable {
|
|||||||
do {
|
do {
|
||||||
let authors = try decoder.decode([Author].self, from: data)
|
let authors = try decoder.decode([Author].self, from: data)
|
||||||
return Set(authors)
|
return Set(authors)
|
||||||
}
|
} catch {
|
||||||
catch {
|
|
||||||
assertionFailure("JSON representation of Author array could not be decoded: \(jsonString) error: \(error)")
|
assertionFailure("JSON representation of Author array could not be decoded: \(jsonString) error: \(error)")
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
@ -76,8 +74,7 @@ extension Set where Element == Author {
|
|||||||
do {
|
do {
|
||||||
let jsonData = try encoder.encode(Array(self))
|
let jsonData = try encoder.encode(Array(self))
|
||||||
return String(data: jsonData, encoding: .utf8)
|
return String(data: jsonData, encoding: .utf8)
|
||||||
}
|
} catch {
|
||||||
catch {
|
|
||||||
assertionFailure("JSON representation of Author array could not be encoded: \(self) error: \(error)")
|
assertionFailure("JSON representation of Author array could not be encoded: \(self) error: \(error)")
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user