 }
 
 class RefCount<Element>: Producer<Element> {
-    typealias State = (count: Int, connectableSubscription: Disposable?)
+    typealias State = (
+        count: Int,
+        connectableSubscription: Disposable?
+    )
     
     var lock = Lock()
     

                        self.parent.state.count = 1
                        self.parent.state.connectableSubscription = disposable
                        return SuccessResult
                    }
                }
                else {

                    return SuccessResult
                }
            }
        } >>> {
            return success(AnonymousDisposable {
                (*subscriptionResult).dispose()
                self.parent.lock.performLocked {
                    let state = self.parent.state
                    if state.count == 1 {
                        state.connectableSubscription!.dispose()
                        self.parent.state.count = 0
                        self.parent.state.connectableSubscription = nil
                    }
                    else if state.count > 1 {
                        self.parent.state.count = state.count - 1
                    }
                    else {
                        rxFatalError("Something went wrong with RefCount disposing mechanism")
                    }
                }
            })
        }
    }

    func on(event: Event<Element>) -> Result<Void> {
