swiftgemini

[ACTIVE] gemini protocol in swift
git clone git://git.figbert.com/swiftgemini.git
Log | Files | Refs | README

commit f24a4e6c3bb74b404dc843410e9c1c7f2161dcb0
parent c3cf6ba8c8d2b14db241a68ddd8a7bfd81203fc1
Author: FIGBERT <figbert@figbert.com>
Date:   Sat,  3 Sep 2022 13:49:15 -0700

Omit url argument label

Diffstat:
MSources/SwiftGemini/SwiftGemini.swift | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Sources/SwiftGemini/SwiftGemini.swift b/Sources/SwiftGemini/SwiftGemini.swift @@ -11,9 +11,9 @@ public class GeminiRequestor { public init() {} - public func request(url: URL) async throws -> GeminiResponse { + public func request(_ url: URL) async throws -> GeminiResponse { let response: GeminiResponse = try await withCheckedThrowingContinuation({ continuation in - requestWithCompletion(url: url, completion: { result in + requestWithCompletion(url, completion: { result in switch result { case .success(let response): continuation.resume(returning: response) @@ -25,7 +25,7 @@ public class GeminiRequestor { return response } - public func requestWithCompletion(url: URL, completion: @escaping (Result<GeminiResponse, Error>) -> Void) { + public func requestWithCompletion(_ url: URL, completion: @escaping (Result<GeminiResponse, Error>) -> Void) { guard url.user == nil && url.password == nil, url.host != nil && url.absoluteString.data(using: .utf8)!.count <= 1024 else { return }