mirror of
https://github.com/apple/swift-collections
synced 2026-11-28 05:04:21 +00:00
Add subscript requirements to [Mutable]Container with borrow/mutate accessors
This commit is contained in:
11 files changed
+59
-41
No files matched your search
@@ -59,10 +59,8 @@ extension UniqueSet where Element: ~Copyable {
|
||||
|
||||
@inlinable
|
||||
public subscript(index: Index) -> Element {
|
||||
// FIXME: Use borrow accessor here
|
||||
unsafeAddress {
|
||||
_checkItemIndex(index)
|
||||
return .init(_storage._memberPtr(at: index._bucket))
|
||||
borrow {
|
||||
_storage[index]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user