refactor(examples): Use if-let chains in oauth_cli

This commit is contained in:
Jonas Platte
2025-06-29 18:31:35 +02:00
committed by Damir Jelić
parent 4a1249fa96
commit cd03a58083
+4 -6
View File
@@ -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!(