From f70114e8d738e7c35afa32b880ec4e997198f81f Mon Sep 17 00:00:00 2001 From: Danny Moesch Date: Sun, 5 Jul 2020 23:41:27 +0200 Subject: [PATCH] Enable SwiftLint rule 'unused_optional_binding' and fix all violations --- .swiftlint.yml | 2 +- pass/AppDelegate.swift | 2 +- pass/Controllers/PasswordEditorTableViewController.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.swiftlint.yml b/.swiftlint.yml index 24a9f6e..bd10bdc 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -182,7 +182,7 @@ whitelist_rules: - unused_declaration - unused_enumerated - unused_import -# - unused_optional_binding + - unused_optional_binding - unused_setter_value - valid_ibinspectable - vertical_parameter_alignment diff --git a/pass/AppDelegate.swift b/pass/AppDelegate.swift index e1e1daa..2b4a3ff 100644 --- a/pass/AppDelegate.swift +++ b/pass/AppDelegate.swift @@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } func application(_: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask { - if let _ = window?.rootViewController as? PasscodeLockViewController { + if window?.rootViewController is PasscodeLockViewController { window?.frame = UIScreen.main.bounds } return .all diff --git a/pass/Controllers/PasswordEditorTableViewController.swift b/pass/Controllers/PasswordEditorTableViewController.swift index f08a0c5..7cbf241 100644 --- a/pass/Controllers/PasswordEditorTableViewController.swift +++ b/pass/Controllers/PasswordEditorTableViewController.swift @@ -417,7 +417,7 @@ extension PasswordEditorTableViewController: PasswordSettingSliderTableViewCellD extension PasswordEditorTableViewController: QRScannerControllerDelegate { func checkScannedOutput(line: String) -> (accept: Bool, message: String) { - if let url = URL(string: line), let _ = Token(url: url) { + if let url = URL(string: line), Token(url: url) != nil { return (accept: true, message: "ValidTokenUrl".localize()) } else { return (accept: false, message: "InvalidTokenUrl".localize())