Skip to content

Commit

Permalink
update: make WordPressPost hashable
Browse files Browse the repository at this point in the history
  • Loading branch information
devahmedshendy authored and leogdion committed Sep 7, 2023
1 parent eade198 commit 0a07741
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Sources/SyndiKit/Formats/Media/Wordpress/WordPressPost.swift
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,16 @@ public extension WordPressPost {
}
}

extension WordPressPost: Hashable {
public static func == (lhs: WordPressPost, rhs: WordPressPost) -> Bool {
lhs.ID == rhs.ID
}

public func hash(into hasher: inout Hasher) {
hasher.combine(ID)
}
}

public extension Entryable {
var wpPost: WordPressPost? {
guard let rssItem = self as? RSSItem else {
Expand Down

0 comments on commit 0a07741

Please sign in to comment.