Remove collection conformances to Equatable and Hashable (#124)

This commit is contained in:
Tim Vermeulen authored and GitHub committed 2021-04-09 14:44:16 -05:00
1 parent bcdbac800a
commit abc5559ef6
14 files changed
+2 -209

No files matched your search

-45
View File
@@ -179,48 +179,3 @@ extension CompactedCollection: LazySequenceProtocol
where Base: LazySequenceProtocol {}
extension CompactedCollection: LazyCollectionProtocol
where Base: LazyCollectionProtocol {}
// Hashable and Equatable conformance are based on each non-nil
// element on base collection.
extension CompactedSequence: Equatable
where Base.Element: Equatable {
@inlinable
public static func ==(lhs: CompactedSequence,
rhs: CompactedSequence) -> Bool {
lhs.elementsEqual(rhs)
}
}
extension CompactedSequence: Hashable
where Element: Hashable {
@inlinable
public func hash(into hasher: inout Hasher) {
for element in self {
hasher.combine(element)
}
}
}
extension CompactedCollection: Equatable
where Base.Element: Equatable {
@inlinable
public static func ==(lhs: CompactedCollection,
rhs: CompactedCollection) -> Bool {
lhs.elementsEqual(rhs)
}
}
extension CompactedCollection: Hashable
where Element: Hashable {
@inlinable
public func hash(into hasher: inout Hasher) {
for element in self {
hasher.combine(element)
}
}
}