From ac1074324db74aa6df9a76002a49ad311fcbf949 Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Sun, 17 Mar 2024 22:59:31 +0100 Subject: [PATCH] Implemented the "==(lhs: rhs: )" static function of the Equatable protocol for the Review model in the Feed library. --- .../Feed/Kit/Sources/Models/Review.swift | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Libraries/Feed/Kit/Sources/Models/Review.swift b/Libraries/Feed/Kit/Sources/Models/Review.swift index d32a656..e1728b3 100644 --- a/Libraries/Feed/Kit/Sources/Models/Review.swift +++ b/Libraries/Feed/Kit/Sources/Models/Review.swift @@ -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 + } + +}