refactor(examples): Use if-let chains in oauth_cli
This commit is contained in:
committed by
Damir Jelić
parent
4a1249fa96
commit
cd03a58083
@@ -140,12 +140,10 @@ impl OAuthCli {
|
||||
let cli = Self { client, restored: false, session_file };
|
||||
|
||||
if let Err(error) = cli.register_and_login().await {
|
||||
if error.downcast_ref::<OAuthError>().is_some_and(|error| {
|
||||
matches!(
|
||||
error,
|
||||
OAuthError::ClientRegistration(OAuthClientRegistrationError::NotSupported)
|
||||
)
|
||||
}) {
|
||||
if let Some(error) = error.downcast_ref::<OAuthError>()
|
||||
&& let OAuthError::ClientRegistration(OAuthClientRegistrationError::NotSupported) =
|
||||
error
|
||||
{
|
||||
// This would require to register with the authorization server manually, which
|
||||
// we don't support here.
|
||||
bail!(
|
||||
|
||||
Reference in New Issue
Block a user