Skip to content

Commit c2f236f

Browse files
committed
Remove sendability warnings
Modifications: * change hardcoded `UInt8` characters to `let` * make `MemcachedFlags` `Sendable` * make `TimeToLive` `Sendable` * make `MemcachedRequest` `Sendable`
1 parent 9ae24ae commit c2f236f

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

Sources/SwiftMemcache/Extensions/UInt8+Characters.swift

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@
1313
//===----------------------------------------------------------------------===//
1414

1515
extension UInt8 {
16-
static var whitespace: UInt8 = .init(ascii: " ")
17-
static var newline: UInt8 = .init(ascii: "\n")
18-
static var carriageReturn: UInt8 = .init(ascii: "\r")
19-
static var m: UInt8 = .init(ascii: "m")
20-
static var s: UInt8 = .init(ascii: "s")
21-
static var g: UInt8 = .init(ascii: "g")
22-
static var d: UInt8 = .init(ascii: "d")
23-
static var v: UInt8 = .init(ascii: "v")
24-
static var T: UInt8 = .init(ascii: "T")
25-
static var M: UInt8 = .init(ascii: "M")
26-
static var P: UInt8 = .init(ascii: "P")
27-
static var A: UInt8 = .init(ascii: "A")
28-
static var E: UInt8 = .init(ascii: "E")
29-
static var R: UInt8 = .init(ascii: "R")
30-
static var zero: UInt8 = .init(ascii: "0")
31-
static var nine: UInt8 = .init(ascii: "9")
16+
static let whitespace: UInt8 = .init(ascii: " ")
17+
static let newline: UInt8 = .init(ascii: "\n")
18+
static let carriageReturn: UInt8 = .init(ascii: "\r")
19+
static let m: UInt8 = .init(ascii: "m")
20+
static let s: UInt8 = .init(ascii: "s")
21+
static let g: UInt8 = .init(ascii: "g")
22+
static let d: UInt8 = .init(ascii: "d")
23+
static let v: UInt8 = .init(ascii: "v")
24+
static let T: UInt8 = .init(ascii: "T")
25+
static let M: UInt8 = .init(ascii: "M")
26+
static let P: UInt8 = .init(ascii: "P")
27+
static let A: UInt8 = .init(ascii: "A")
28+
static let E: UInt8 = .init(ascii: "E")
29+
static let R: UInt8 = .init(ascii: "R")
30+
static let zero: UInt8 = .init(ascii: "0")
31+
static let nine: UInt8 = .init(ascii: "9")
3232
}

Sources/SwiftMemcache/MemcachedFlags.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
/// The 'v' flag for the meta get command dictates whether the item value should be returned in the data block.
1919
/// The 'T' flag is used for both the meta get and meta set commands to specify the Time-To-Live (TTL) for an item.
2020
/// The 't' flag for the meta get command indicates whether the Time-To-Live (TTL) for the item should be returned.
21-
struct MemcachedFlags {
21+
struct MemcachedFlags: Sendable {
2222
/// Flag 'v' for the 'mg' (meta get) command.
2323
///
2424
/// If true, the item value is returned in the data block.
@@ -41,7 +41,7 @@ struct MemcachedFlags {
4141
}
4242

4343
/// Enum representing the Time-To-Live (TTL) of a Memcached value.
44-
public enum TimeToLive: Equatable, Hashable {
44+
public enum TimeToLive: Sendable, Equatable, Hashable {
4545
/// The value should never expire.
4646
case indefinitely
4747
/// The value should expire after a specified time.

Sources/SwiftMemcache/MemcachedRequest.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@
1313
//===----------------------------------------------------------------------===//
1414

1515
import NIOCore
16-
enum MemcachedRequest {
17-
struct SetCommand {
16+
enum MemcachedRequest: Sendable {
17+
struct SetCommand: Sendable {
1818
let key: String
1919
var value: ByteBuffer
2020
var flags: MemcachedFlags?
2121
}
2222

23-
struct GetCommand {
23+
struct GetCommand: Sendable {
2424
let key: String
2525
var flags: MemcachedFlags
2626
}
2727

28-
struct DeleteCommand {
28+
struct DeleteCommand: Sendable {
2929
let key: String
3030
}
3131

0 commit comments

Comments
 (0)