Auto-fix clippy::collapsible_if violations (#36428)
Release Notes: - N/A
This commit is contained in:
parent
9e8ec72bd5
commit
8f567383e4
281 changed files with 6628 additions and 7089 deletions
|
@ -864,22 +864,23 @@ impl Client {
|
|||
let mut credentials = None;
|
||||
|
||||
let old_credentials = self.state.read().credentials.clone();
|
||||
if let Some(old_credentials) = old_credentials {
|
||||
if self.validate_credentials(&old_credentials, cx).await? {
|
||||
credentials = Some(old_credentials);
|
||||
}
|
||||
if let Some(old_credentials) = old_credentials
|
||||
&& self.validate_credentials(&old_credentials, cx).await?
|
||||
{
|
||||
credentials = Some(old_credentials);
|
||||
}
|
||||
|
||||
if credentials.is_none() && try_provider {
|
||||
if let Some(stored_credentials) = self.credentials_provider.read_credentials(cx).await {
|
||||
if self.validate_credentials(&stored_credentials, cx).await? {
|
||||
credentials = Some(stored_credentials);
|
||||
} else {
|
||||
self.credentials_provider
|
||||
.delete_credentials(cx)
|
||||
.await
|
||||
.log_err();
|
||||
}
|
||||
if credentials.is_none()
|
||||
&& try_provider
|
||||
&& let Some(stored_credentials) = self.credentials_provider.read_credentials(cx).await
|
||||
{
|
||||
if self.validate_credentials(&stored_credentials, cx).await? {
|
||||
credentials = Some(stored_credentials);
|
||||
} else {
|
||||
self.credentials_provider
|
||||
.delete_credentials(cx)
|
||||
.await
|
||||
.log_err();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -894,10 +894,10 @@ impl UserStore {
|
|||
let mut ret = Vec::with_capacity(users.len());
|
||||
for user in users {
|
||||
let user = User::new(user);
|
||||
if let Some(old) = self.users.insert(user.id, user.clone()) {
|
||||
if old.github_login != user.github_login {
|
||||
self.by_github_login.remove(&old.github_login);
|
||||
}
|
||||
if let Some(old) = self.users.insert(user.id, user.clone())
|
||||
&& old.github_login != user.github_login
|
||||
{
|
||||
self.by_github_login.remove(&old.github_login);
|
||||
}
|
||||
self.by_github_login
|
||||
.insert(user.github_login.clone(), user.id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue