diff --git a/Sources/Nuke/Pipeline/ImagePipeline.swift b/Sources/Nuke/Pipeline/ImagePipeline.swift index d766b4b0b..627e339d9 100644 --- a/Sources/Nuke/Pipeline/ImagePipeline.swift +++ b/Sources/Nuke/Pipeline/ImagePipeline.swift @@ -133,21 +133,14 @@ public final class ImagePipeline: @unchecked Sendable { } /// Returns an image for the given URL. - /// - /// - parameters: - /// - request: An image URL. public func image(for url: URL) async throws -> PlatformImage { try await image(for: ImageRequest(url: url)) } /// Returns an image for the given request. - /// - /// - parameters: - /// - request: An image request. public func image(for request: ImageRequest) async throws -> PlatformImage { // Optimization: fetch image directly without creating an associated `AsyncImageTask` - let task = makeImageTask(request: request) - return try await response(for: task).image + try await response(for: makeImageTask(request: request)).image } private func response(for task: ImageTask, stream: AsyncStream.Continuation? = nil) async throws -> ImageResponse {