From 94203c890d0e0086fb7e28b0d00c3d7c6738430e Mon Sep 17 00:00:00 2001 From: "Dr. Michael Lauer" Date: Wed, 17 Jul 2024 18:46:36 +0200 Subject: [PATCH] Bump to Swift 5.10 and nest the connector protocol. --- Package.resolved | 9 ++++---- Package.swift | 2 +- .../Protocols/Connector.swift | 22 +++++++++---------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Package.resolved b/Package.resolved index 1a70771..7f8665a 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,4 +1,5 @@ { + "originHash" : "3e8b58a52ac40e39626cfccd52a0e16c5b7ae7277adb7adc9a190a6c45c151ab", "pins" : [ { "identity" : "anycodable", @@ -24,7 +25,7 @@ "location" : "https://github.com/Cornucopia-Swift/CornucopiaCore", "state" : { "branch" : "master", - "revision" : "c0346f93f603ff63aa72523094c0397686c71f45" + "revision" : "c4b3ee10c067395fdb9daaa93eaf61c4017323a5" } }, { @@ -59,10 +60,10 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-crypto", "state" : { - "revision" : "bc1c29221f6dfeb0ebbfbc98eb95cd3d4967868e", - "version" : "3.4.0" + "revision" : "46072478ca365fe48370993833cb22de9b41567f", + "version" : "3.5.2" } } ], - "version" : 2 + "version" : 3 } diff --git a/Package.swift b/Package.swift index 3a1d660..beccbac 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.7 +// swift-tools-version: 5.10 import PackageDescription diff --git a/Sources/CornucopiaStreams/Protocols/Connector.swift b/Sources/CornucopiaStreams/Protocols/Connector.swift index b039057..55b21fa 100644 --- a/Sources/CornucopiaStreams/Protocols/Connector.swift +++ b/Sources/CornucopiaStreams/Protocols/Connector.swift @@ -1,18 +1,18 @@ // // Cornucopia – (C) Dr. Lauer Information Technology // -import CornucopiaCore import Foundation -/// Describes a transport connector protocol. -protocol _CornucopiaTransportConnector { +extension Cornucopia.Streams { - /// Creates a connector for connecting to the specified ``URL``. - init(url: URL) - /// Connects and returns a stream pair. - func connect() async throws -> Cornucopia.Streams.StreamPair - /// Cancels this connection, if possible. - func cancel() -} + /// Describes a transport connector protocol. + protocol Connector { -extension Cornucopia.Streams { typealias Connector = _CornucopiaTransportConnector } + /// Creates a connector for connecting to the specified ``URL``. + init(url: URL) + /// Connects and returns a stream pair. + func connect() async throws -> Cornucopia.Streams.StreamPair + /// Cancels this connection, if possible. + func cancel() + } +}