Skip to content

Commit d11f84e

Browse files
committed
Incorporate feedback
1 parent 0e289e0 commit d11f84e

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Sources/Overlays/_Testing_CoreGraphics/Attachments/Attachment+AttachableAsCGImage.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ extension Attachment {
3939
fileprivate init<T>(
4040
attachableValue: T,
4141
named preferredName: String?,
42-
as contentType: (any Sendable)?,
42+
contentType: (any Sendable)?,
4343
encodingQuality: Float,
4444
sourceLocation: SourceLocation
4545
) where AttachableValue == _AttachableImageContainer<T> {
@@ -111,7 +111,7 @@ extension Attachment {
111111
encodingQuality: Float = 1.0,
112112
sourceLocation: SourceLocation = #_sourceLocation
113113
) where AttachableValue == _AttachableImageContainer<T> {
114-
self.init(attachableValue: attachableValue, named: preferredName, as: contentType, encodingQuality: encodingQuality, sourceLocation: sourceLocation)
114+
self.init(attachableValue: attachableValue, named: preferredName, contentType: contentType, encodingQuality: encodingQuality, sourceLocation: sourceLocation)
115115
}
116116

117117
/// Initialize an instance of this type that encloses the given image.
@@ -141,7 +141,7 @@ extension Attachment {
141141
encodingQuality: Float = 1.0,
142142
sourceLocation: SourceLocation = #_sourceLocation
143143
) where AttachableValue == _AttachableImageContainer<T> {
144-
self.init(attachableValue: attachableValue, named: preferredName, as: nil, encodingQuality: encodingQuality, sourceLocation: sourceLocation)
144+
self.init(attachableValue: attachableValue, named: preferredName, contentType: nil, encodingQuality: encodingQuality, sourceLocation: sourceLocation)
145145
}
146146
}
147147
#endif

Sources/Overlays/_Testing_CoreGraphics/Attachments/ImageAttachmentError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//
1010

1111
#if SWT_TARGET_OS_APPLE && canImport(CoreGraphics)
12-
/// A type representing errors that can occur when attaching an image.
12+
/// A type representing an error that can occur when attaching an image.
1313
package enum ImageAttachmentError: Error, CustomStringConvertible {
1414
/// The specified content type did not conform to `.image`.
1515
case contentTypeDoesNotConformToImage

Sources/Overlays/_Testing_CoreGraphics/Attachments/_AttachableImageContainer.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import UniformTypeIdentifiers
2525
/// to eagerly serialize them, which is unnecessarily expensive if we know
2626
/// they're actually concurrency-safe.
2727
/// 2. We would have no place to store metadata such as the encoding quality
28-
/// (although in the future we may introduce a "metadata" associated type to
28+
/// (although in the future we may introduce a "metadata" associated type to
2929
/// `Attachable` that could store that info.)
3030
/// 3. `Attachable` has a requirement with `Self` in non-parameter, non-return
3131
/// position. As far as Swift is concerned, a non-final class cannot satisfy
@@ -48,14 +48,14 @@ import UniformTypeIdentifiers
4848
///
4949
/// - [`CGImage`](https://developer.apple.com/documentation/coregraphics/cgimage)
5050
@_spi(Experimental)
51-
public struct _AttachableImageContainer<ImageClass>: Sendable where ImageClass: AttachableAsCGImage {
51+
public struct _AttachableImageContainer<Image>: Sendable where Image: AttachableAsCGImage {
5252
/// The underlying image.
5353
///
5454
/// `CGImage` and `UIImage` are sendable, but `NSImage` is not. `NSImage`
5555
/// instances can be created from closures that are run at rendering time.
5656
/// The AppKit cross-import overlay is responsible for ensuring that any
5757
/// instances of this type it creates hold "safe" `NSImage` instances.
58-
nonisolated(unsafe) var image: ImageClass
58+
nonisolated(unsafe) var image: Image
5959

6060
/// The encoding quality to use when encoding the represented image.
6161
public var encodingQuality: Float
@@ -77,7 +77,7 @@ public struct _AttachableImageContainer<ImageClass>: Sendable where ImageClass:
7777
}
7878
}
7979

80-
init(image: ImageClass, encodingQuality: Float) {
80+
init(image: Image, encodingQuality: Float) {
8181
self.image = image._makeCopyForAttachment()
8282
self.encodingQuality = encodingQuality
8383
}
@@ -106,7 +106,7 @@ extension UTType {
106106
}
107107

108108
extension _AttachableImageContainer: AttachableContainer {
109-
public var attachableValue: ImageClass {
109+
public var attachableValue: Image {
110110
image
111111
}
112112

0 commit comments

Comments
 (0)