Skip to content

Commit 529fb6c

Browse files
visheshjzhou77
authored andcommitted
fix warnings in build
1 parent 43e8bbf commit 529fb6c

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import PackageDescription
2424
let package = Package(
2525
name: "FoundationDB",
2626
platforms: [
27-
.macOS(.v14),
27+
.macOS(.v15),
2828
],
2929
products: [
3030
.library(name: "FoundationDB", targets: ["FoundationDB"]),

Sources/FoundationDB/Network.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ final class FDBNetwork: Sendable {
6565

6666
/// Stops the FoundationDB network and waits for the network thread to complete.
6767
deinit {
68-
try networkThread.withLock { networkThread in
68+
_ = networkThread.withLock { networkThread in
6969
if networkThread == nil {
7070
return networkThread
7171
}

Sources/FoundationDB/Transaction.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public final class FDBTransaction: TransactionProtocol, @unchecked Sendable {
158158
}
159159

160160
public func onError(_ error: FDBError) async throws {
161-
try await Future<ResultVoid>(
161+
_ = try await Future<ResultVoid>(
162162
fdb_transaction_on_error(transaction, error.code)
163163
).getAsync()
164164
}

Tests/FoundationDBTests/FoundationDBTupleTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func testTupleNil() throws {
3131

3232
var offset = 1
3333
let decoded = try TupleNil.decodeTuple(from: encoded, at: &offset)
34-
#expect(decoded is TupleNil, "Should decode back to TupleNil")
34+
#expect(type(of: decoded) == TupleNil.self, "Should decode back to TupleNil")
3535
#expect(offset == 1, "Offset should not advance for TupleNil")
3636
}
3737

Tests/StackTester/Sources/StackTester/StackTester.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -296,11 +296,11 @@ class StackMachine {
296296

297297
case "COMMIT":
298298
let transaction = try currentTransaction()
299-
let success = try await transaction.commit()
299+
_ = try await transaction.commit()
300300
store(idx, Array("COMMIT_RESULT".utf8))
301301

302302
case "RESET":
303-
if let transaction = transactionMap[transactionName] as? FDBTransaction {
303+
if transactionMap[transactionName] as? FDBTransaction != nil {
304304
try newTransaction()
305305
}
306306

@@ -329,8 +329,8 @@ class StackMachine {
329329
case "GET_RANGE":
330330
// Python/Go order: begin, end, limit, reverse, mode (but Go pops in reverse)
331331
// Go pops: mode, reverse, limit, endKey, beginKey
332-
let mode = waitAndPop().item as! Int64 // Streaming mode, ignore for now
333-
let reverse = (waitAndPop().item as! Int64) != 0
332+
_ = waitAndPop().item as! Int64 // Streaming mode, ignore for now
333+
_ = (waitAndPop().item as! Int64) != 0
334334
let limit = Int(waitAndPop().item as! Int64)
335335
let endKey = waitAndPop().item as! [UInt8]
336336
let beginKey = waitAndPop().item as! [UInt8]
@@ -348,8 +348,8 @@ class StackMachine {
348348
case "GET_RANGE_STARTS_WITH":
349349
// Python order: prefix, limit, reverse, mode (pops 4 parameters)
350350
// Go order: same but pops in reverse
351-
let mode = waitAndPop().item as! Int64 // Streaming mode, ignore for now
352-
let reverse = (waitAndPop().item as! Int64) != 0
351+
_ = waitAndPop().item as! Int64 // Streaming mode, ignore for now
352+
_ = (waitAndPop().item as! Int64) != 0
353353
let limit = Int(waitAndPop().item as! Int64)
354354
let prefix = waitAndPop().item as! [UInt8]
355355
let transaction = try currentTransaction()
@@ -370,8 +370,8 @@ class StackMachine {
370370
// Python pops 10 parameters: begin_key, begin_or_equal, begin_offset, end_key, end_or_equal, end_offset, limit, reverse, mode, prefix
371371
// Go pops in reverse order
372372
let prefix = waitAndPop().item as! [UInt8]
373-
let mode = waitAndPop().item as! Int64 // Streaming mode, ignore for now
374-
let reverse = (waitAndPop().item as! Int64) != 0
373+
_ = waitAndPop().item as! Int64 // Streaming mode, ignore for now
374+
_ = (waitAndPop().item as! Int64) != 0
375375
let limit = Int(waitAndPop().item as! Int64)
376376
let endOffset = Int(waitAndPop().item as! Int64)
377377
let endOrEqual = (waitAndPop().item as! Int64) != 0
@@ -651,7 +651,7 @@ class StackMachine {
651651

652652
case "START_THREAD":
653653
// Threading not supported in current implementation, just consume the instruction
654-
let instruction = waitAndPop().item
654+
_ = waitAndPop().item
655655
// Could implement this with Task.detached in the future
656656

657657
case "WAIT_EMPTY":

0 commit comments

Comments
 (0)