From fc28bed653a4f7793dc8ac90c9285d5fc8c87f0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mik=C3=A1=20Kruschel?= <20423069+mikakruschel@users.noreply.github.com> Date: Thu, 17 Feb 2022 15:15:48 +0100 Subject: [PATCH] Update example and readme --- Example/Diagnostics-Example/CustomSmartInsights.swift | 6 +++--- README.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Example/Diagnostics-Example/CustomSmartInsights.swift b/Example/Diagnostics-Example/CustomSmartInsights.swift index 96d52b9..c38d232 100644 --- a/Example/Diagnostics-Example/CustomSmartInsights.swift +++ b/Example/Diagnostics-Example/CustomSmartInsights.swift @@ -10,8 +10,8 @@ import Foundation import Diagnostics struct SmartInsightsProvider: SmartInsightsProviding { - func smartInsights(for chapter: DiagnosticsChapter) -> [SmartInsightProviding]? { - guard let html = chapter.diagnostics as? HTML else { return nil } + func smartInsights(for chapter: DiagnosticsChapter) -> [SmartInsightProviding] { + guard let html = chapter.diagnostics as? HTML else { return [] } if html.errorLogs.contains(where: { $0.contains("AppDelegate.ExampleLocalizedError") }) { return [ SmartInsight( @@ -20,6 +20,6 @@ struct SmartInsightsProvider: SmartInsightsProviding { ) ] } - return nil + return [] } } diff --git a/README.md b/README.md index 95b4e81..41aeaba 100644 --- a/README.md +++ b/README.md @@ -219,8 +219,8 @@ It's possible to provide your own custom insights based on the chapters in the r ```swift struct SmartInsightsProvider: SmartInsightsProviding { - func smartInsights(for chapter: DiagnosticsChapter) -> [SmartInsightProviding]? { - guard let html = chapter.diagnostics as? HTML else { return nil } + func smartInsights(for chapter: DiagnosticsChapter) -> [SmartInsightProviding] { + guard let html = chapter.diagnostics as? HTML else { return [] } if html.errorLogs.contains(where: { $0.contains("AppDelegate.ExampleLocalizedError") }) { return [ SmartInsight( @@ -229,7 +229,7 @@ struct SmartInsightsProvider: SmartInsightsProviding { ) ] } - return nil + return [] } } ```