Skip to content

Commit 697806e

Browse files
committed
style: apply swiftformat 0.62.1
1 parent 4d3ad55 commit 697806e

5 files changed

Lines changed: 33 additions & 11 deletions

File tree

Sources/ElevenLabs/Internal/Conversation/AgentStateManager.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ final class AgentStateManager {
5353
transitionTo(.speaking)
5454

5555
case .userTranscript:
56-
if currentState != .speaking { transitionTo(.thinking) }
56+
if currentState != .speaking {
57+
transitionTo(.thinking)
58+
}
5759

5860
case .interruption:
5961
cancelAllTimers()

Sources/ElevenLabs/Internal/Networking/WebRTCConnectionManager.swift

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,9 @@ final class LiveKitReadinessDelegate: RoomDelegate {
391391
/// if the awaiting task is cancelled or `release()` is called (e.g. on disconnect).
392392
/// Single-caller — there's exactly one `waitForAgentReady` per connection lifetime.
393393
func awaitRemoteParticipant() async throws {
394-
if let outcome { return try outcome.get() }
394+
if let outcome {
395+
return try outcome.get()
396+
}
395397
try await withTaskCancellationHandler {
396398
try await withCheckedThrowingContinuation { (cont: CheckedContinuation<Void, Error>) in
397399
if let outcome {
@@ -417,13 +419,17 @@ final class LiveKitReadinessDelegate: RoomDelegate {
417419

418420
nonisolated func roomDidConnect(_ room: Room) {
419421
Task { @MainActor in
420-
if room.remoteParticipants.values.contains(where: isAgentParticipant) { self.markReady() }
422+
if room.remoteParticipants.values.contains(where: isAgentParticipant) {
423+
self.markReady()
424+
}
421425
}
422426
}
423427

424428
nonisolated func room(_: Room, participantDidConnect participant: RemoteParticipant) {
425429
Task { @MainActor in
426-
if isAgentParticipant(participant) { self.markReady() }
430+
if isAgentParticipant(participant) {
431+
self.markReady()
432+
}
427433
}
428434
}
429435

Sources/ElevenLabs/Public/Conversation/ConversationState.swift

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,23 @@ public enum ConversationState: Equatable, Sendable {
88
case error(ConversationError)
99

1010
public var isActive: Bool {
11-
if case .active = self { return true }
11+
if case .active = self {
12+
return true
13+
}
1214
return false
1315
}
1416

1517
var isEnded: Bool {
16-
if case .ended = self { return true }
18+
if case .ended = self {
19+
return true
20+
}
1721
return false
1822
}
1923

2024
var activeAgentId: String? {
21-
if case let .active(info) = self { return info.agentId }
25+
if case let .active(info) = self {
26+
return info.agentId
27+
}
2228
return nil
2329
}
2430
}

Tests/ElevenLabsTests/Unit/ErrorHandlingIntegrationTests.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,12 +324,16 @@ final class ErrorHandlingIntegrationTests: XCTestCase {
324324

325325
// Verify we got expected state transitions
326326
XCTAssertTrue(capturedStartupStates.contains { state in
327-
if case .resolvingToken = state { return true }
327+
if case .resolvingToken = state {
328+
return true
329+
}
328330
return false
329331
}, "Should have resolvingToken state")
330332

331333
XCTAssertTrue(capturedStartupStates.contains { state in
332-
if case .failed = state { return true }
334+
if case .failed = state {
335+
return true
336+
}
333337
return false
334338
}, "Should have failed state")
335339
}

Tests/ElevenLabsTests/Unit/SoftwareMuteProcessorTests.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,16 @@ final class SoftwareMuteProcessorTests: XCTestCase {
166166
}
167167
var isDone = false
168168
let inputBlock: AVAudioConverterInputBlock = { _, outStatus in
169-
if isDone { outStatus.pointee = .noDataNow; return nil }
169+
if isDone {
170+
outStatus.pointee = .noDataNow; return nil
171+
}
170172
outStatus.pointee = .haveData; isDone = true; return readBuffer
171173
}
172174
var error: NSError?
173175
converter.convert(to: converted, error: &error, withInputFrom: inputBlock)
174-
if let error { throw error }
176+
if let error {
177+
throw error
178+
}
175179
outputBuffer = converted
176180
} else {
177181
outputBuffer = readBuffer

0 commit comments

Comments
 (0)