Enable shorthand_optional_binding SwiftLint rule. (#582)

This commit is contained in:
Doug 2023-02-15 09:34:48 +00:00 committed by GitHub
parent afc660a1ea
commit 6211f121a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 3 deletions

View File

@ -8,6 +8,7 @@ opt_in_rules:
- force_unwrapping
- private_action
- explicit_init
- shorthand_optional_binding
included:
- ElementX

View File

@ -24,7 +24,7 @@ struct UserIndicatorModalView: View {
var body: some View {
ZStack {
VStack(spacing: 12.0) {
if let progressFraction = progressFraction {
if let progressFraction {
ProgressView(value: progressFraction)
} else {
ProgressView()

View File

@ -205,7 +205,7 @@ final class LoginCoordinator: CoordinatorProtocol {
let coordinator = ServerSelectionCoordinator(parameters: parameters)
coordinator.callback = { [weak self, weak coordinator] action in
guard let self, let coordinator = coordinator else { return }
guard let self, let coordinator else { return }
self.serverSelectionCoordinator(coordinator, didCompleteWith: action)
}

View File

@ -40,7 +40,7 @@ class EmojiProvider: EmojiProviderProtocol {
func getCategories(searchString: String? = nil) async -> [EmojiCategory] {
let emojiCategories = await loadIfNeeded()
if let searchString = searchString, searchString.isEmpty == false {
if let searchString, searchString.isEmpty == false {
return search(searchString: searchString, emojiCategories: emojiCategories)
} else {
return emojiCategories

1
changelog.d/pr-579.build Normal file
View File

@ -0,0 +1 @@
Update SwiftLint and SwiftFormat rules.