From fe17ff9c23152cbb5a5f9635e8070b6f9da30e27 Mon Sep 17 00:00:00 2001 From: Alberto De Bortoli Date: Tue, 30 Jun 2020 22:20:13 +0100 Subject: [PATCH] Make Future's setResult, setError and cancel methods public --- Promis/Classes/Future.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Promis/Classes/Future.swift b/Promis/Classes/Future.swift index fe43b6e..9888265 100644 --- a/Promis/Classes/Future.swift +++ b/Promis/Classes/Future.swift @@ -167,14 +167,14 @@ public class Future { return !timeoutExpired } - // MARK: State setting (Private) + // MARK: State setting /** Resolves the receiver by setting a result. - parameter result: The result to use for the resolution. */ - func setResult(_ result: ResultType) { + public func setResult(_ result: ResultType) { cv.lock() assert(state == .unresolved, "Cannot set result. Future already resolved") @@ -195,7 +195,7 @@ public class Future { - parameter error: The error to use for the resolution. */ - func setError(_ error: Error) { + public func setError(_ error: Error) { cv.lock() assert(state == .unresolved, "Cannot set error. Future already resolved") @@ -214,7 +214,7 @@ public class Future { /** Resolves the receiver by cancelling it. */ - func cancel() { + public func cancel() { cv.lock() assert(state == .unresolved, "Cannot cancel. Future already resolved")