Skip to content

Commit 0096c5b

Browse files
authored
Add the @discardableResult attribute to OrderedSet.insert(_:at:) (apple#21)
* Add the @discardableResult attribute to OrderedSet.insert(_:at:). Fixes apple#19 * Add the @discardableResult attribute to OrderedSet.updateOrAppend(_). * Add the @discardableResult attribute to OrderedSet.updateOrInsert(_:at:).
1 parent d2395c5 commit 0096c5b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Sources/OrderedCollections/OrderedSet/OrderedSet+Insertions.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ extension OrderedSet {
152152
/// type, if it implements high-quality hashing. (Insertions need to make
153153
/// room in the storage array to add the inserted element.)
154154
@inlinable
155+
@discardableResult
155156
public mutating func insert(
156157
_ item: Element,
157158
at index: Index
@@ -206,6 +207,7 @@ extension OrderedSet {
206207
/// hash, and compare operations on the `Element` type, if it implements
207208
/// high-quality hashing.
208209
@inlinable
210+
@discardableResult
209211
public mutating func updateOrAppend(_ item: Element) -> Element? {
210212
let (inserted, index) = _append(item)
211213
if inserted { return nil }
@@ -234,6 +236,7 @@ extension OrderedSet {
234236
/// hash, and compare operations on the `Element` type, if it implements
235237
/// high-quality hashing.
236238
@inlinable
239+
@discardableResult
237240
public mutating func updateOrInsert(
238241
_ item: Element,
239242
at index: Index

0 commit comments

Comments
 (0)