@@ -222,26 +222,6 @@ extension __ExpectationContext {
222
222
// MARK: - Collection comparison and diffing
223
223
224
224
extension __ExpectationContext {
225
- /// Convert an instance of `CollectionDifference` to one that is type-erased
226
- /// over elements of type `Any`.
227
- ///
228
- /// - Parameters:
229
- /// - difference: The difference to convert.
230
- ///
231
- /// - Returns: A type-erased copy of `difference`.
232
- private static func _typeEraseCollectionDifference( _ difference: CollectionDifference < some Any > ) -> CollectionDifference < Any > {
233
- CollectionDifference < Any > (
234
- difference. lazy. map { change in
235
- switch change {
236
- case let . insert( offset, element, associatedWith) :
237
- return . insert( offset: offset, element: element as Any , associatedWith: associatedWith)
238
- case let . remove( offset, element, associatedWith) :
239
- return . remove( offset: offset, element: element as Any , associatedWith: associatedWith)
240
- }
241
- }
242
- ) !
243
- }
244
-
245
225
/// Generate a description of a previously-computed collection difference.
246
226
///
247
227
/// - Parameters:
@@ -317,7 +297,7 @@ extension __ExpectationContext {
317
297
318
298
if !result {
319
299
differences [ opID] = { [ lhs, rhs] in
320
- Self . _typeEraseCollectionDifference ( lhs. difference ( from: rhs) )
300
+ CollectionDifference < Any > ( lhs. difference ( from: rhs) )
321
301
}
322
302
}
323
303
@@ -380,7 +360,7 @@ extension __ExpectationContext {
380
360
return nil
381
361
}
382
362
383
- return Self . _typeEraseCollectionDifference ( diff)
363
+ return CollectionDifference < Any > ( diff)
384
364
}
385
365
}
386
366
0 commit comments