From 1f5ca7b0805ec22b305fa22c2ed0c42aa64f63ff Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Thu, 22 Oct 2026 14:02:53 -0700 Subject: [PATCH] Remove unneeded return keywords. --- Mac/AppDefaults.swift | 46 ++++++++++++++++++++-------------------- Shared/AppDefaults.swift | 22 +++++++++---------- iOS/AppDefaults.swift | 26 +++++++++++------------ 3 files changed, 47 insertions(+), 47 deletions(-) diff --git a/Mac/AppDefaults.swift b/Mac/AppDefaults.swift index aed027cc5..aa395f7bd 100644 --- a/Mac/AppDefaults.swift +++ b/Mac/AppDefaults.swift @@ -90,7 +90,7 @@ extension AppDefaults { static var openInBrowserInBackground: Bool { get { - return AppDefaults.bool(for: Key.openInBrowserInBackground) + AppDefaults.bool(for: Key.openInBrowserInBackground) } set { AppDefaults.setBool(for: Key.openInBrowserInBackground, newValue) @@ -102,15 +102,15 @@ extension AppDefaults { static var subscribeToFeedDefaults: UserDefaults { if let appGroupID = Bundle.main.object(forInfoDictionaryKey: "AppGroup") as? String, let appGroupDefaults = UserDefaults(suiteName: appGroupID) { - return appGroupDefaults + appGroupDefaults } else { - return UserDefaults.standard + UserDefaults.standard } } static var subscribeToFeedsInDefaultBrowser: Bool { get { - return subscribeToFeedDefaults.bool(forKey: Key.subscribeToFeedsInDefaultBrowser) + subscribeToFeedDefaults.bool(forKey: Key.subscribeToFeedsInDefaultBrowser) } set { subscribeToFeedDefaults.set(newValue, forKey: Key.subscribeToFeedsInDefaultBrowser) @@ -119,7 +119,7 @@ extension AppDefaults { static var sidebarFontSize: FontSize { get { - return fontSize(for: Key.sidebarFontSize) + fontSize(for: Key.sidebarFontSize) } set { AppDefaults.setFontSize(for: Key.sidebarFontSize, newValue) @@ -128,7 +128,7 @@ extension AppDefaults { static var timelineFontSize: FontSize { get { - return fontSize(for: Key.timelineFontSize) + fontSize(for: Key.timelineFontSize) } set { AppDefaults.setFontSize(for: Key.timelineFontSize, newValue) @@ -137,7 +137,7 @@ extension AppDefaults { static var detailFontSize: FontSize { get { - return fontSize(for: Key.detailFontSize) + fontSize(for: Key.detailFontSize) } set { AppDefaults.setFontSize(for: Key.detailFontSize, newValue) @@ -146,7 +146,7 @@ extension AppDefaults { static var importOPMLAccountID: String? { get { - return AppDefaults.string(for: Key.importOPMLAccountID) + AppDefaults.string(for: Key.importOPMLAccountID) } set { AppDefaults.setString(for: Key.importOPMLAccountID, newValue) @@ -155,7 +155,7 @@ extension AppDefaults { static var exportOPMLAccountID: String? { get { - return AppDefaults.string(for: Key.exportOPMLAccountID) + AppDefaults.string(for: Key.exportOPMLAccountID) } set { AppDefaults.setString(for: Key.exportOPMLAccountID, newValue) @@ -164,7 +164,7 @@ extension AppDefaults { static var defaultBrowserID: String? { get { - return AppDefaults.string(for: Key.defaultBrowserID) + AppDefaults.string(for: Key.defaultBrowserID) } set { AppDefaults.setString(for: Key.defaultBrowserID, newValue) @@ -172,16 +172,16 @@ extension AppDefaults { } static var showTitleOnMainWindow: Bool { - return AppDefaults.bool(for: Key.showTitleOnMainWindow) + AppDefaults.bool(for: Key.showTitleOnMainWindow) } static var showDebugMenu: Bool { - return AppDefaults.bool(for: Key.showDebugMenu) - } + AppDefaults.bool(for: Key.showDebugMenu) + } static var feedDoubleClickMarkAsRead: Bool { get { - return AppDefaults.bool(for: Key.feedDoubleClickMarkAsRead) + AppDefaults.bool(for: Key.feedDoubleClickMarkAsRead) } set { AppDefaults.setBool(for: Key.feedDoubleClickMarkAsRead, newValue) @@ -190,7 +190,7 @@ extension AppDefaults { static var suppressSyncOnLaunch: Bool { get { - return AppDefaults.bool(for: Key.suppressSyncOnLaunch) + AppDefaults.bool(for: Key.suppressSyncOnLaunch) } set { AppDefaults.setBool(for: Key.suppressSyncOnLaunch, newValue) @@ -199,7 +199,7 @@ extension AppDefaults { static var webInspectorEnabled: Bool { get { - return AppDefaults.bool(for: Key.webInspectorEnabled) + AppDefaults.bool(for: Key.webInspectorEnabled) } set { AppDefaults.setBool(for: Key.webInspectorEnabled, newValue) @@ -208,7 +208,7 @@ extension AppDefaults { static var webInspectorStartsAttached: Bool { get { - return AppDefaults.bool(for: Key.webInspectorStartsAttached) + AppDefaults.bool(for: Key.webInspectorStartsAttached) } set { AppDefaults.setBool(for: Key.webInspectorStartsAttached, newValue) @@ -275,7 +275,7 @@ extension AppDefaults { } static var timelineShowsSeparators: Bool { - return AppDefaults.bool(for: Key.timelineShowsSeparators) + AppDefaults.bool(for: Key.timelineShowsSeparators) } static var articleTextSize: ArticleTextSize { @@ -334,13 +334,13 @@ extension AppDefaults { static func actualFontSize(for fontSize: FontSize) -> CGFloat { switch fontSize { case .small: - return NSFont.systemFontSize + NSFont.systemFontSize case .medium: - return actualFontSize(for: .small) + 1.0 + actualFontSize(for: .small) + 1.0 case .large: - return actualFontSize(for: .medium) + 4.0 + actualFontSize(for: .medium) + 4.0 case .veryLarge: - return actualFontSize(for: .large) + 8.0 + actualFontSize(for: .large) + 8.0 } } } @@ -349,7 +349,7 @@ private extension AppDefaults { static func fontSize(for key: String) -> FontSize { // Punted till after 1.0. - return .medium + .medium // var rawFontSize = int(for: key) // if rawFontSize < smallestFontSizeRawValue { diff --git a/Shared/AppDefaults.swift b/Shared/AppDefaults.swift index b3d48bec0..5475751b4 100644 --- a/Shared/AppDefaults.swift +++ b/Shared/AppDefaults.swift @@ -50,7 +50,7 @@ enum AppDefaults { static var lastImageCacheFlushDate: Date? { get { - return date(for: Key.lastImageCacheFlushDate) + date(for: Key.lastImageCacheFlushDate) } set { setDate(for: Key.lastImageCacheFlushDate, newValue) @@ -59,7 +59,7 @@ enum AppDefaults { static var addFeedAccountID: String? { get { - return string(for: Key.addFeedAccountID) + string(for: Key.addFeedAccountID) } set { setString(for: Key.addFeedAccountID, newValue) @@ -68,7 +68,7 @@ enum AppDefaults { static var addFeedFolderName: String? { get { - return string(for: Key.addFeedFolderName) + string(for: Key.addFeedFolderName) } set { setString(for: Key.addFeedFolderName, newValue) @@ -77,7 +77,7 @@ enum AppDefaults { static var addFolderAccountID: String? { get { - return string(for: Key.addFolderAccountID) + string(for: Key.addFolderAccountID) } set { setString(for: Key.addFolderAccountID, newValue) @@ -86,7 +86,7 @@ enum AppDefaults { static var currentThemeName: String? { get { - return string(for: Key.currentThemeName) + string(for: Key.currentThemeName) } set { setString(for: Key.currentThemeName, newValue) @@ -95,7 +95,7 @@ enum AppDefaults { static var isArticleContentJavascriptEnabled: Bool { get { - return bool(for: Key.articleContentJavascriptEnabled) + bool(for: Key.articleContentJavascriptEnabled) } set { setBool(for: Key.articleContentJavascriptEnabled, newValue) @@ -118,7 +118,7 @@ enum AppDefaults { extension AppDefaults { static func string(for key: String) -> String? { - return UserDefaults.standard.string(forKey: key) + UserDefaults.standard.string(forKey: key) } static func setString(for key: String, _ value: String?) { @@ -126,7 +126,7 @@ extension AppDefaults { } static func bool(for key: String) -> Bool { - return UserDefaults.standard.bool(forKey: key) + UserDefaults.standard.bool(forKey: key) } static func setBool(for key: String, _ flag: Bool) { @@ -134,7 +134,7 @@ extension AppDefaults { } static func int(for key: String) -> Int { - return UserDefaults.standard.integer(forKey: key) + UserDefaults.standard.integer(forKey: key) } static func setInt(for key: String, _ x: Int) { @@ -142,7 +142,7 @@ extension AppDefaults { } static func date(for key: String) -> Date? { - return UserDefaults.standard.object(forKey: key) as? Date + UserDefaults.standard.object(forKey: key) as? Date } static func setDate(for key: String, _ date: Date?) { @@ -162,7 +162,7 @@ private extension AppDefaults { static var firstRunDate: Date? { get { - return date(for: Key.firstRunDate) + date(for: Key.firstRunDate) } set { setDate(for: Key.firstRunDate, newValue) diff --git a/iOS/AppDefaults.swift b/iOS/AppDefaults.swift index 160e9f486..7597f247e 100644 --- a/iOS/AppDefaults.swift +++ b/iOS/AppDefaults.swift @@ -21,11 +21,11 @@ enum UserInterfaceColorPalette: Int, CustomStringConvertible, CaseIterable { var description: String { switch self { case .automatic: - return NSLocalizedString("Automatic", comment: "Automatic") + NSLocalizedString("Automatic", comment: "Automatic") case .light: - return NSLocalizedString("Light", comment: "Light") + NSLocalizedString("Light", comment: "Light") case .dark: - return NSLocalizedString("Dark", comment: "Dark") + NSLocalizedString("Dark", comment: "Dark") } } } @@ -84,7 +84,7 @@ extension AppDefaults { static var useSystemBrowser: Bool { get { - return UserDefaults.standard.bool(forKey: Key.useSystemBrowser) + UserDefaults.standard.bool(forKey: Key.useSystemBrowser) } set { UserDefaults.standard.setValue(newValue, forKey: Key.useSystemBrowser) @@ -93,7 +93,7 @@ extension AppDefaults { static var timelineGroupByFeed: Bool { get { - return AppDefaults.bool(for: Key.timelineGroupByFeed) + AppDefaults.bool(for: Key.timelineGroupByFeed) } set { AppDefaults.setBool(for: Key.timelineGroupByFeed, newValue) @@ -102,7 +102,7 @@ extension AppDefaults { static var refreshClearsReadArticles: Bool { get { - return AppDefaults.bool(for: Key.refreshClearsReadArticles) + AppDefaults.bool(for: Key.refreshClearsReadArticles) } set { AppDefaults.setBool(for: Key.refreshClearsReadArticles, newValue) @@ -111,7 +111,7 @@ extension AppDefaults { static var timelineSortDirection: ComparisonResult { get { - return AppDefaults.sortDirection(for: Key.timelineSortDirection) + AppDefaults.sortDirection(for: Key.timelineSortDirection) } set { AppDefaults.setSortDirection(for: Key.timelineSortDirection, newValue) @@ -120,7 +120,7 @@ extension AppDefaults { static var articleFullscreenAvailable: Bool { get { - return AppDefaults.bool(for: Key.articleFullscreenAvailable) + AppDefaults.bool(for: Key.articleFullscreenAvailable) } set { AppDefaults.setBool(for: Key.articleFullscreenAvailable, newValue) @@ -129,7 +129,7 @@ extension AppDefaults { static var articleFullscreenEnabled: Bool { get { - return articleFullscreenAvailable && AppDefaults.bool(for: Key.articleFullscreenEnabled) + articleFullscreenAvailable && AppDefaults.bool(for: Key.articleFullscreenEnabled) } set { AppDefaults.setBool(for: Key.articleFullscreenEnabled, newValue) @@ -142,7 +142,7 @@ extension AppDefaults { static var confirmMarkAllAsRead: Bool { get { - return AppDefaults.bool(for: Key.confirmMarkAllAsRead) + AppDefaults.bool(for: Key.confirmMarkAllAsRead) } set { AppDefaults.setBool(for: Key.confirmMarkAllAsRead, newValue) @@ -151,7 +151,7 @@ extension AppDefaults { static var splitViewPreferredDisplayMode: Int { get { - return AppDefaults.int(for: Key.splitViewPreferredDisplayMode) + AppDefaults.int(for: Key.splitViewPreferredDisplayMode) } set { AppDefaults.setInt(for: Key.splitViewPreferredDisplayMode, newValue) @@ -188,7 +188,7 @@ extension AppDefaults { static var lastRefresh: Date? { get { - return AppDefaults.date(for: Key.lastRefresh) + AppDefaults.date(for: Key.lastRefresh) } set { AppDefaults.setDate(for: Key.lastRefresh, newValue) @@ -197,7 +197,7 @@ extension AppDefaults { static var timelineNumberOfLines: Int { get { - return AppDefaults.int(for: Key.timelineNumberOfLines) + AppDefaults.int(for: Key.timelineNumberOfLines) } set { AppDefaults.setInt(for: Key.timelineNumberOfLines, newValue)