mirror of
https://github.com/apple/swift-collections
synced 2026-11-27 04:54:21 +00:00
Review error handling
This commit is contained in:
16 files changed
+148
-126
No files matched your search
@@ -96,12 +96,13 @@ extension UniqueSet where Element: Copyable {
|
||||
#if UnstableContainersPreview
|
||||
@_alwaysEmitIntoClient
|
||||
public init<
|
||||
S: Iterable_<Element, Never> & Sequence<Element>
|
||||
S: Iterable_ & Sequence<Element>
|
||||
>(
|
||||
copying items: borrowing S
|
||||
) {
|
||||
) throws(S.Failure_)
|
||||
where S.Element_ == Element {
|
||||
self.init()
|
||||
self._insert(copying: items)
|
||||
try self._insert(copying: items)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -173,11 +173,12 @@ extension UniqueSet /* where Element: Copyable */ {
|
||||
@_alwaysEmitIntoClient
|
||||
@inline(__always)
|
||||
public mutating func insert<
|
||||
S: Iterable_<Element, Never> & Sequence<Element>
|
||||
S: Iterable_ & Sequence<Element>
|
||||
>(
|
||||
copying items: borrowing S
|
||||
) {
|
||||
_insert(copying: items)
|
||||
) throws(S.Failure_)
|
||||
where S.Element_ == Element {
|
||||
try _insert(copying: items)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user