From 6eefe7b2183d31a7cd9ba9c638db072345403c48 Mon Sep 17 00:00:00 2001 From: Christopher Jr Riley Date: Wed, 15 May 2024 23:01:17 -0400 Subject: [PATCH] Comment out extractCborBlocks; simplify CBOR print --- .../ATProtoKit/Utilities/ATCBORManager.swift | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/Sources/ATProtoKit/Utilities/ATCBORManager.swift b/Sources/ATProtoKit/Utilities/ATCBORManager.swift index 468572b55f..cc8e26b174 100644 --- a/Sources/ATProtoKit/Utilities/ATCBORManager.swift +++ b/Sources/ATProtoKit/Utilities/ATCBORManager.swift @@ -43,9 +43,10 @@ public class ATCBORManager { do { let items = try decodeItems(from: data) - if let cborBlocks = extractCborBlocks(from: items) { - print("Decoded CBOR:", cborBlocks) - } +// if let cborBlocks = extractCborBlocks(from: items) { +// print("Decoded CBOR:", cborBlocks) +// } + print("Decoded CBOR: \(items)") } catch { print("Failed to decode CBOR: \(error)") } @@ -66,18 +67,18 @@ public class ATCBORManager { return decoded } - /// <#Description#> - /// - /// - Parameter items: <#items description#> - /// - Returns: <#description#> - private func extractCborBlocks(from items: [CBOR]) -> [UInt8]? { - guard let payload = items.last, - let cborBlocks = payload["blocks"], - case .byteString(let array) = cborBlocks else { - return nil - } - return array - } +// /// Extracts a CBOR block for the purpose of decoding. +// /// +// /// - Parameter items: An array of `CBOR` objects. +// /// - Returns: An array of `UInt8` objects. +// private func extractCborBlocks(from items: [CBOR]) -> [UInt8]? { +// guard let payload = items.last, +// let cborBlocks = payload["blocks"], +// case .byteString(let array) = cborBlocks else { +// return nil +// } +// return array +// } /// A delegate that runs when a CBOR object is decoded. public typealias OnCarDecoded = (CarProgressStatusEvent) -> Void