Don't unwrap now-non-optionals, and unwrap now-explicit optionals

This commit is contained in:
Nate Weaver 2020-02-08 17:43:16 -06:00
parent fe6fbd31a8
commit 4ac8107f27
2 changed files with 7 additions and 6 deletions

View File

@ -29,16 +29,14 @@ class HTMLFeedFinder {
}
}
if let bodyLinks = RSHTMLLinkParser.htmlLinks(with: parserData) {
let bodyLinks = RSHTMLLinkParser.htmlLinks(with: parserData)
for oneBodyLink in bodyLinks {
if linkMightBeFeed(oneBodyLink) {
let normalizedURL = oneBodyLink.urlString.normalizedURL
if linkMightBeFeed(oneBodyLink), let normalizedURL = oneBodyLink.urlString?.normalizedURL {
let oneFeedSpecifier = FeedSpecifier(title: oneBodyLink.text, urlString: normalizedURL, source: .HTMLLink)
addFeedSpecifier(oneFeedSpecifier)
}
}
}
}
}

View File

@ -12,8 +12,9 @@ import RSParser
extension RSHTMLMetadata {
func largestOpenGraphImageURL() -> String? {
let openGraphImages = openGraphProperties.images
guard let openGraphImages = openGraphProperties?.images, !openGraphImages.isEmpty else {
guard !openGraphImages.isEmpty else {
return nil
}
@ -47,7 +48,9 @@ extension RSHTMLMetadata {
func largestAppleTouchIcon() -> String? {
guard let icons = appleTouchIcons, !icons.isEmpty else {
let icons = appleTouchIcons
guard !icons.isEmpty else {
return nil
}