Enable SwiftLint rule 'unused_optional_binding' and fix all violations

This commit is contained in:
Danny Moesch 2020-07-05 23:41:27 +02:00 committed by Mingshen Sun
parent ab80e5297e
commit f70114e8d7
3 changed files with 3 additions and 3 deletions

View file

@ -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

View file

@ -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

View file

@ -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())