Enable SwiftLint rule 'contains_over_first_not_nil' and fix all violations

This commit is contained in:
Danny Moesch 2020-07-04 22:01:01 +02:00 committed by Mingshen Sun
parent 08473f8f05
commit 7d79314bae
2 changed files with 2 additions and 2 deletions

View file

@ -23,7 +23,7 @@ whitelist_rules:
- conditional_returns_on_newline - conditional_returns_on_newline
- contains_over_filter_count - contains_over_filter_count
- contains_over_filter_is_empty - contains_over_filter_is_empty
# - contains_over_first_not_nil - contains_over_first_not_nil
- control_statement - control_statement
# - convenience_type # - convenience_type
- custom_rules - custom_rules

View file

@ -265,7 +265,7 @@ class PasswordEditorTableViewController: UITableViewController {
// Remove delimiter configuration for XKCD style passwords. Re-add it for random ones. // Remove delimiter configuration for XKCD style passwords. Re-add it for random ones.
switch flavor { switch flavor {
case .random: case .random:
guard tableData[1].first(where: isPasswordDelimiterCellData) == nil else { if tableData[1].contains(where: isPasswordDelimiterCellData) {
return return
} }
tableData[1].insert([.type: PasswordEditorCellType.passwordGroupsCell], at: tableData[1].endIndex) tableData[1].insert([.type: PasswordEditorCellType.passwordGroupsCell], at: tableData[1].endIndex)