From 84105b1b95864c5cc71fff7084206bdfacedb828 Mon Sep 17 00:00:00 2001 From: Dariusz Rybicki <dariusz@elixxir.io> Date: Tue, 8 Nov 2022 11:32:59 +0100 Subject: [PATCH] Refactor GetNotificationsReport.live func into let --- .../Functions/GetNotificationsReport.swift | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/Sources/XXClient/Functions/GetNotificationsReport.swift b/Sources/XXClient/Functions/GetNotificationsReport.swift index b545d663..7984285a 100644 --- a/Sources/XXClient/Functions/GetNotificationsReport.swift +++ b/Sources/XXClient/Functions/GetNotificationsReport.swift @@ -14,23 +14,22 @@ public struct GetNotificationsReport { } extension GetNotificationsReport { - public static func live() -> GetNotificationsReport { - GetNotificationsReport { e2eId, notificationCSV, services in - var error: NSError? - let result = BindingsGetNotificationsReport( - e2eId, - notificationCSV, - try services.encode(), - &error - ) - if let error = error { - throw error - } - guard let result = result else { - fatalError("BindingsGetNotificationsReport returned nil without providing error") - } - return try NotificationReport.decode(result) + public static let live = GetNotificationsReport { + e2eId, notificationCSV, services in + var error: NSError? + let result = BindingsGetNotificationsReport( + e2eId, + notificationCSV, + try services.encode(), + &error + ) + if let error = error { + throw error } + guard let result = result else { + fatalError("BindingsGetNotificationsReport returned nil without providing error") + } + return try NotificationReport.decode(result) } } -- GitLab