Implemented the "==(lhs: rhs: )" static function of the Equatable protocol for the Review model in the Feed library.

This commit is contained in:
Javier Cicchelli 2024-03-17 22:59:31 +01:00
parent 0e84dcde30
commit ac1074324d

View File

@ -8,7 +8,7 @@
import Foundation
public struct Review: Equatable {
public struct Review {
// MARK: Constants
public let author: String
@ -39,3 +39,22 @@ public struct Review: Equatable {
}
}
// MARK: - Equatable
extension Review: Equatable {
// MARK: Functions
public static func == (
lhs: Review,
rhs: Review
) -> Bool {
lhs.author == rhs.author
&& lhs.content == rhs.content
&& lhs.id == rhs.id
&& lhs.rating == rhs.rating
&& lhs.title == rhs.title
&& lhs.version == rhs.version
&& lhs.updated.description == rhs.updated.description
}
}