Skip to content

Commit dce8b0a

Browse files
authored
Remove Cancellable conformances.
1 parent 4cffe30 commit dce8b0a

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

Sources/CombineInteroperability/Utilities.swift

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,7 @@ import Combine
44
extension Lifetime {
55
@available(macOS 10.15, iOS 13.0, tvOS 13.0, macCatalyst 13.0, watchOS 6.0, *)
66
@discardableResult
7-
public static func += <C: Cancellable>(lhs: Lifetime, rhs: C) -> Disposable? {
8-
lhs.observeEnded(rhs.cancel)
7+
public static func += <C: Cancellable>(lhs: Lifetime, rhs: C?) -> Disposable? {
8+
rhs.flatMap { lhs.observeEnded($0.cancel) }
99
}
1010
}
11-
12-
@available(macOS 10.15, iOS 13.0, tvOS 13.0, macCatalyst 13.0, watchOS 6.0, *)
13-
extension AnyDisposable: Cancellable {
14-
public func cancel() {
15-
dispose()
16-
}
17-
}
18-
19-
@available(macOS 10.15, iOS 13.0, tvOS 13.0, macCatalyst 13.0, watchOS 6.0, *)
20-
extension SerialDisposable: Cancellable {
21-
public func cancel() {
22-
dispose()
23-
}
24-
}
25-
26-
@available(macOS 10.15, iOS 13.0, tvOS 13.0, macCatalyst 13.0, watchOS 6.0, *)
27-
extension CompositeDisposable: Cancellable {
28-
public func cancel() {
29-
dispose()
30-
}
31-
}
32-
#endif

0 commit comments

Comments
 (0)