Files
swift-collections/Sources/PersistentCollections/PersistentDictionary/PersistentDictionary+Descriptions.swift
T
Karoy Lorentey ab750075a2 [PersistentCollections] Add missing Custom[Debug]StringConvertable conformances, review existing ones
Add `Custom[Debug]StringConformance` conformances on:

- `PersistentDictionary.Keys`
- `PersistentDictionary.Values`
- `PersistentDictionary.Index`
- `PersistentSet.Index`
2022-10-20 17:14:52 -07:00

32 lines
1.0 KiB
Swift

//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Collections open source project
//
// Copyright (c) 2022 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
//
//===----------------------------------------------------------------------===//
import _CollectionsUtilities
extension PersistentDictionary: CustomStringConvertible {
// A textual representation of this instance.
public var description: String {
_dictionaryDescription(for: self)
}
}
extension PersistentDictionary: CustomDebugStringConvertible {
/// A textual representation of this instance, suitable for debugging.
public var debugDescription: String {
_dictionaryDescription(
for: self, debug: true, typeName: Self._debugTypeName())
}
internal static func _debugTypeName() -> String {
"PersistentDictionary<\(Key.self), \(Value.self)>"
}
}