Implemented the "==(lhs: rhs: )" static function of the Equatable protocol for the Review model in the Feed library.
This commit is contained in:
parent
0e84dcde30
commit
ac1074324d
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
public struct Review: Equatable {
|
public struct Review {
|
||||||
|
|
||||||
// MARK: Constants
|
// MARK: Constants
|
||||||
public let author: String
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user