diff --git a/Sources/CoreKit/Guarantee+Validation.swift b/Sources/CoreKit/Guarantee+Validation.swift index cb9f37c8..a8c3e62b 100644 --- a/Sources/CoreKit/Guarantee+Validation.swift +++ b/Sources/CoreKit/Guarantee+Validation.swift @@ -48,7 +48,7 @@ extension Guarantee { /// /// - Requires: The given `value` must satisfy the `predicate` of this type. /// - @inlinable public init(_ value: consuming Value, prune error: @autoclosure () -> Error) throws where Error: Swift.Error { + @inlinable public init(_ value: consuming Value, prune error: @autoclosure () -> Error) throws(Error) { guard Self.predicate(value) else { throw error() } self.init(unsafe:/**/value) } diff --git a/Sources/CoreKit/Models/Fallible+Validation.swift b/Sources/CoreKit/Models/Fallible+Validation.swift index cc29bf51..64d34be0 100644 --- a/Sources/CoreKit/Models/Fallible+Validation.swift +++ b/Sources/CoreKit/Models/Fallible+Validation.swift @@ -31,19 +31,19 @@ extension Fallible { } } - /// Tries to return its `value` but throws `failure()` on `error`. - @inlinable public consuming func prune(_ failure: @autoclosure () -> Error) throws(Error) -> Value { + /// Tries to return its `value` but throws `error()` on `error`. + @inlinable public consuming func prune(_ error: @autoclosure () -> Error) throws(Error) -> Value { if self.error { - throw failure() + throw error() } else { return self.value } } - /// Tries to return its `value` but returns `failure()` on `error`. - @inlinable public consuming func result(_ failure: @autoclosure () -> Error) -> Result { + /// Tries to return its `value` but returns `error()` on `error`. + @inlinable public consuming func result(_ error: @autoclosure () -> Error) -> Result { if self.error { - return Result.failure(failure()) + return Result.failure(error()) } else { return Result.success(self.value) }