From 8594638b84c87dc796a0472f48d951013fa1270a Mon Sep 17 00:00:00 2001 From: kean Date: Sat, 27 Apr 2024 20:50:08 -0400 Subject: [PATCH] Cleanup ImagePipeline --- Sources/Nuke/Pipeline/ImagePipeline.swift | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) 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 {