Skip to content

Commit eedddda

Browse files
committed
Merge remote-tracking branch 'origin/jgrynspan/image-attachment-tweaks' into jgrynspan/image-attachment-tweaks
2 parents 384df6d + bc2130d commit eedddda

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

proposals/testing/NNNN-image-attachment-adjustments.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,19 @@ that its first argument has an explicit label:
108108
This change makes the type's interface more consistent between Darwin and
109109
Windows (where it has an `init(encoderCLSID:encodingQuality:)` initializer.)
110110

111-
As well, conformance to `Equatable` and `Hashable` is added:
111+
As well, conformances to `Equatable`, `Hashable`, `CustomStringConvertible`, and
112+
`CustomDebugStringConvertible` are added:
112113

113114
```swift
114115
extension AttachableImageFormat: Equatable, Hashable {}
116+
extension AttachableImageFormat: CustomStringConvertible, CustomDebugStringConvertible {}
115117
```
116118

117119
Conformance to `Equatable` is necessary to correctly implement the
118120
`withUnsafeBytes(as:_:)` protocol requirement mentioned above, and conformance
119-
to `Hashable` is generally useful and straightforward to implement.
121+
to `Hashable` is generally useful and straightforward to implement. Conformance
122+
to `CustomStringConvertible` and `CustomDebugStringConvertible` allows for
123+
better diagnostic output (especially if an encoding failure occurs.)
120124

121125
### Adding an imageFormat property to Attachment
122126

0 commit comments

Comments
 (0)