From ca320c555aa22d7322ffd35304c85ddbf7d32f91 Mon Sep 17 00:00:00 2001 From: sunxiaojian Date: Thu, 29 Apr 2021 19:24:03 +0800 Subject: [PATCH] fix: code format --- .../Onboarding/Register/MastodonRegisterViewModel.swift | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Mastodon/Scene/Onboarding/Register/MastodonRegisterViewModel.swift b/Mastodon/Scene/Onboarding/Register/MastodonRegisterViewModel.swift index 5fd8c31b..309204a9 100644 --- a/Mastodon/Scene/Onboarding/Register/MastodonRegisterViewModel.swift +++ b/Mastodon/Scene/Onboarding/Register/MastodonRegisterViewModel.swift @@ -91,7 +91,7 @@ final class MastodonRegisterViewModel { let query = Mastodon.API.Account.AccountLookupQuery(acct: text) return context.apiService.accountLookup(domain: domain, query: query, authorization: self.applicationAuthorization) .map { - response -> Result, Error>in + response -> Result, Error> in Result.success(response) } .catch { error in @@ -100,9 +100,7 @@ final class MastodonRegisterViewModel { .eraseToAnyPublisher() } .switchToLatest() - .sink(receiveCompletion: { _ in - - }, receiveValue: { [weak self] result in + .sink { [weak self] result in guard let self = self else { return } switch result { case .success: @@ -111,7 +109,7 @@ final class MastodonRegisterViewModel { case .failure: break } - }) + } .store(in: &disposeBag) usernameValidateState