Skip to content

Commit 49962ad

Browse files
committed
Add Metadata overload
1 parent 2be4be7 commit 49962ad

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Sources/GRPCCore/Metadata.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,13 @@ public struct Metadata: Sendable, Hashable {
178178
self.elements.append(contentsOf: other.map(KeyValuePair.init))
179179
}
180180

181+
/// Add the contents of another `Metadata` to this instance.
182+
///
183+
/// - Parameter other: the `Metadata` whose key-value pairs should be added into this one.
184+
public mutating func add(contentsOf other: Metadata) {
185+
self.elements.append(contentsOf: other.elements)
186+
}
187+
181188
/// Removes all values associated with the given key.
182189
///
183190
/// - Parameter key: The key for which all values should be removed.

0 commit comments

Comments
 (0)