Skip to content

Commit a633e80

Browse files
committed
formatting
1 parent 94384b4 commit a633e80

File tree

4 files changed

+18
-19
lines changed

4 files changed

+18
-19
lines changed

Sources/DistributedActors/ActorID.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ extension ClusterSystem.ActorID {
4040
self.id = key.id
4141
self.keyType = type(of: key)
4242
}
43-
43+
4444
public var wrappedValue: Value {
4545
get { fatalError("called wrappedValue getter") }
4646
set { fatalError("called wrappedValue setter") }
@@ -931,11 +931,13 @@ extension ActorID: Codable {
931931

932932
let keys = ActorMetadataKeys()
933933
if (metadataSettings == nil || metadataSettings!.propagateMetadata.contains(keys.path.id)),
934-
let value = self.metadata.path {
934+
let value = self.metadata.path
935+
{
935936
try metadataContainer.encode(value, forKey: ActorCoding.MetadataKeys.path)
936937
}
937938
if (metadataSettings == nil || metadataSettings!.propagateMetadata.contains(keys.type.id)),
938-
let value = self.metadata.type {
939+
let value = self.metadata.type
940+
{
939941
try metadataContainer.encode(value, forKey: ActorCoding.MetadataKeys.type)
940942
}
941943

@@ -960,7 +962,7 @@ extension ActorID: Codable {
960962
if let context = decoder.actorSerializationContext {
961963
let decodeCustomMetadata = context.system.settings.actorMetadata.decodeCustomMetadata
962964
try decodeCustomMetadata(metadataContainer, self.metadata)
963-
965+
964966
// for (key, value) in try decodeCustomMetadata(metadataContainer) {
965967
// func store(_: K.Type) {
966968
// if let value = tag.value as? K.Value {

Sources/DistributedActors/ActorIDMetadataSettings.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ internal struct ActorIDMetadataSettings {
5252
internal var encodeCustomMetadata: (ActorMetadata, inout KeyedEncodingContainer<ActorCoding.MetadataKeys>) throws -> Void =
5353
{ _, _ in () }
5454

55-
internal var decodeCustomMetadata: ((KeyedDecodingContainer<ActorCoding.MetadataKeys>, ActorMetadata) throws -> ()) =
55+
internal var decodeCustomMetadata: ((KeyedDecodingContainer<ActorCoding.MetadataKeys>, ActorMetadata) throws -> Void) =
5656
{ _, _ in () }
5757
}

Sources/DistributedActors/ActorMetadata.swift

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ import Distributed
1818
// ==== ----------------------------------------------------------------------------------------------------------------
1919
// MARK: ActorMetadata
2020

21-
public struct ActorMetadataKeys {
21+
public enum ActorMetadataKeys {
2222
public typealias Key = ActorMetadataKey
2323
}
2424

2525
extension ActorMetadataKeys {
2626
var path: Key<ActorPath> { "$path" }
27-
27+
2828
var type: Key<ActorTypeTagValue> { "$type" }
2929
struct ActorTypeTagValue: Codable { // FIXME: improve representation to be more efficient
3030
let mangledName: String
@@ -82,7 +82,7 @@ public final class ActorMetadata: CustomStringConvertible, CustomDebugStringConv
8282
self._storage[id] = newValue
8383
}
8484
}
85-
85+
8686
subscript(_ id: String) -> (any Sendable & Codable)? {
8787
get {
8888
self.lock.wait()
@@ -122,9 +122,7 @@ public final class ActorMetadata: CustomStringConvertible, CustomDebugStringConv
122122
// ==== ----------------------------------------------------------------------------------------------------------------
123123
// MARK: ActorTagKey
124124

125-
public protocol AnyActorMetadataKey {
126-
127-
}
125+
public protocol AnyActorMetadataKey {}
128126

129127
/// Declares a key to be used with ``ActorMetadata``, which allows attaching various metadata to an ``ActorID``.
130128
public struct ActorMetadataKey<Value: Codable & Sendable>: Hashable, ExpressibleByStringLiteral {
@@ -140,28 +138,28 @@ public struct ActorMetadataKey<Value: Codable & Sendable>: Hashable, Expressible
140138
}
141139

142140
///// Used to tag actor identities with additional information.
143-
//public protocol ActorMetadataProtocol: Sendable where Value == Key.Value {
141+
// public protocol ActorMetadataProtocol: Sendable where Value == Key.Value {
144142
// /// Type of the actor tag key, used to obtain an actor tag instance.
145143
// associatedtype Key: ActorTagKey<Value>
146144
//
147145
// /// Type of the value stored by this tag.
148146
// associatedtype Value
149147
//
150148
// var value: Value { get }
151-
//}
149+
// }
152150
//
153-
//@available(*, deprecated, message: "remove this")
154-
//public protocol ActorTagKey<Value>: Sendable {
151+
// @available(*, deprecated, message: "remove this")
152+
// public protocol ActorTagKey<Value>: Sendable {
155153
// associatedtype Value: Sendable & Codable
156154
// static var id: String { get }
157-
//}
155+
// }
158156
//
159157
//// ==== ----------------------------------------------------------------------------------------------------------------
160158
//
161-
//extension ActorMetadataProtocol {
159+
// extension ActorMetadataProtocol {
162160
// /// String representation of the unique key tag identity, equal to `Key.id`.
163161
// ///
164162
// /// Tag keys should be unique, and must not start with $ unless they are declared by the ClusterSystem itself.
165163
// public var id: String { Key.id }
166164
// public var keyType: Key.Type { Key.self }
167-
//}
165+
// }

Sources/DistributedActors/ClusterSystem.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,6 @@ extension ClusterSystem {
856856
try makeActor()
857857
}
858858
}
859-
860859
}
861860

862861
extension ClusterSystem {

0 commit comments

Comments
 (0)