mirror of
https://github.com/pointfreeco/swift-custom-dump.git
synced 2026-04-07 19:17:35 +00:00
We currently auto-sort the children of any mirror with a display style of dictionary or set alphabetically. This is important for consistent dumps (good for snapshot tests, too), but affects types that don't need the sorting, like ordered dictionaries and sets. This PR introduces an `_UnorderedCollection` protocol to control this behavior, and conforms `Dictionary`, `Set`, and their `NS`- predecessors, but leaves other types open to dumping and diffing in an ordered way by default.
8 lines
233 B
Swift
8 lines
233 B
Swift
import Foundation
|
|
|
|
public protocol _UnorderedCollection {}
|
|
extension Dictionary: _UnorderedCollection {}
|
|
extension NSDictionary: _UnorderedCollection {}
|
|
extension NSSet: _UnorderedCollection {}
|
|
extension Set: _UnorderedCollection {}
|