From 0dccdd53de97da3e8bb44a71cdcb55fd4f3ed7f6 Mon Sep 17 00:00:00 2001 From: 1024jp <1024jp@wolfrosch.com> Date: Sun, 16 Jun 2024 19:46:23 +0900 Subject: [PATCH] Support typed error --- CHANGELOG.md | 9 +++++++++ Sources/Gzip/Data+Gzip.swift | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eafe032..5a11ec6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ Change Log ========================== +6.2.0 +-------------------------- + +### Changes + +- Support typed throw. + + + 6.1.0 -------------------------- diff --git a/Sources/Gzip/Data+Gzip.swift b/Sources/Gzip/Data+Gzip.swift index 0c277a9..358ef38 100644 --- a/Sources/Gzip/Data+Gzip.swift +++ b/Sources/Gzip/Data+Gzip.swift @@ -170,7 +170,7 @@ extension Data { /// - Parameter wBits: Manage the size of the history buffer. /// - Returns: Gzip-compressed `Data` instance. /// - Throws: `GzipError` - public func gzipped(level: CompressionLevel = .defaultCompression, wBits: Int32 = Gzip.maxWindowBits + 16) throws -> Data { + public func gzipped(level: CompressionLevel = .defaultCompression, wBits: Int32 = Gzip.maxWindowBits + 16) throws(GzipError) -> Data { guard !self.isEmpty else { return Data() @@ -241,7 +241,7 @@ extension Data { /// - Parameter wBits: Manage the size of the history buffer. /// - Returns: Gzip-decompressed `Data` instance. /// - Throws: `GzipError` - public func gunzipped(wBits: Int32 = Gzip.maxWindowBits + 32) throws -> Data { + public func gunzipped(wBits: Int32 = Gzip.maxWindowBits + 32) throws(GzipError) -> Data { guard !self.isEmpty else { return Data()