Skip to content

Commit d20697f

Browse files
committed
fix compilation
1 parent a450cbb commit d20697f

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

Sources/SwiftAPIClient/Modifiers/LoggingModifier.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ extension APIClient.Configs {
9191
logger.log(level: logLevel, "\(message)")
9292
}
9393
#if canImport(Metrics)
94-
if configs.reportMetrics {
94+
if reportMetrics {
9595
updateTotalRequestsMetrics(for: request)
9696
}
9797
#endif

Sources/SwiftAPIClient/Utils/AnyAsyncSequence.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import Foundation
22

3+
#if swift(<6.0)
34
/// A type-erasing wrapper for any `AsyncSequence`.
5+
@available(*, deprecated, message: "This type is deprecated and will be removed in a future version")
46
public struct AnyAsyncSequence<Element>: AsyncSequence {
57

68
private var _makeAsyncIterator: () -> AsyncIterator
@@ -46,7 +48,9 @@ public extension AsyncSequence {
4648

4749
/// Erases the type of this sequence and returns an `AnyAsyncSequence` instance.
4850
/// - Returns: An instance of `AnyAsyncSequence` wrapping the original sequence.
51+
@available(*, deprecated, message: "This method is deprecated and will be removed in a future version")
4952
func eraseToAnyAsyncSequence() -> AnyAsyncSequence<Element> {
5053
AnyAsyncSequence(self)
5154
}
5255
}
56+
#endif

Sources/SwiftAPIClientMacros/SwiftAPIClientMacros.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public struct SwiftAPIClientCallMacro: PeerMacro {
3838
if funcDecl.signature.effectSpecifiers == nil {
3939
funcDecl.signature.effectSpecifiers = FunctionEffectSpecifiersSyntax()
4040
}
41-
funcDecl.signature.effectSpecifiers?.throwsClause = ThrowsClauseSyntax(throwsSpecifier: "throws")
41+
funcDecl.signature.effectSpecifiers?.throwsSpecifier = "throws"
4242

4343
let isAsync = attribute.caller == "http" || funcDecl.signature.effectSpecifiers?.asyncSpecifier != nil
4444
let callModifier = isAsync ? "try await " : "try "
@@ -259,8 +259,8 @@ public struct SwiftAPIClientPathMacro: MemberMacro, MemberAttributeMacro, PeerMa
259259
public struct SwiftAPIClientFreestandingMacro: DeclarationMacro {
260260

261261
public static func expansion(of node: some FreestandingMacroExpansionSyntax, in context: some MacroExpansionContext) throws -> [DeclSyntax] {
262-
let name = node.macroName.text.lowercased()
263-
var type = node.arguments.first?.expression.trimmed.description ?? ""
262+
let name = node.macro.text.lowercased()
263+
var type = node.argumentList.first?.expression.trimmed.description ?? ""
264264
if type.hasSuffix(".self") {
265265
type.removeLast(5)
266266
}

0 commit comments

Comments
 (0)