diff --git a/Frameworks/Account/Feedly/OAuthAuthorizationCodeGranting.swift b/Frameworks/Account/Feedly/OAuthAuthorizationCodeGranting.swift index 735f33bff..836989e78 100644 --- a/Frameworks/Account/Feedly/OAuthAuthorizationCodeGranting.swift +++ b/Frameworks/Account/Feedly/OAuthAuthorizationCodeGranting.swift @@ -70,12 +70,12 @@ public extension OAuthAuthorizationResponse { guard let queryItems = components.queryItems, !queryItems.isEmpty else { throw URLError(.unsupportedURL) } - let code = queryItems.firstElementPassingTest { $0.name.lowercased() == "code" } + let code = queryItems.first { $0.name.lowercased() == "code" } guard let codeValue = code?.value, !codeValue.isEmpty else { throw URLError(.unsupportedURL) } - let state = queryItems.firstElementPassingTest { $0.name.lowercased() == "state" } + let state = queryItems.first { $0.name.lowercased() == "state" } let stateValue = state?.value self.init(code: codeValue, state: stateValue) diff --git a/Mac/MainWindow/Timeline/Cell/SingleLineTextFieldSizer.swift b/Mac/MainWindow/Timeline/Cell/SingleLineTextFieldSizer.swift index ed18581e9..e40db7235 100644 --- a/Mac/MainWindow/Timeline/Cell/SingleLineTextFieldSizer.swift +++ b/Mac/MainWindow/Timeline/Cell/SingleLineTextFieldSizer.swift @@ -53,7 +53,7 @@ final class SingleLineTextFieldSizer { // that members of such a dictionary were mutated after insertion. // We use just an array of sizers now — which is totally fine, // because there’s only going to be like three of them. - if let cachedSizer = sizers.firstElementPassingTest({ $0.font == font }) { + if let cachedSizer = sizers.first(where: { $0.font == font }) { return cachedSizer } diff --git a/iOS/Article/OpenInSafariActivity.swift b/iOS/Article/OpenInSafariActivity.swift index a157345fb..9b5b5ed8f 100644 --- a/iOS/Article/OpenInSafariActivity.swift +++ b/iOS/Article/OpenInSafariActivity.swift @@ -37,7 +37,7 @@ class OpenInSafariActivity: UIActivity { } override func perform() { - guard let url = activityItems?.firstElementPassingTest({ $0 is URL }) as? URL else { + guard let url = activityItems?.first(where: { $0 is URL }) as? URL else { activityDidFinish(false) return }