From cd03a580839dfecf0518f2879e87d65f30640e00 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Sun, 29 Jun 2025 18:31:35 +0200 Subject: [PATCH] refactor(examples): Use if-let chains in oauth_cli --- examples/oauth_cli/src/main.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/examples/oauth_cli/src/main.rs b/examples/oauth_cli/src/main.rs index e63ab9ab8..ed2d2703b 100644 --- a/examples/oauth_cli/src/main.rs +++ b/examples/oauth_cli/src/main.rs @@ -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::().is_some_and(|error| { - matches!( - error, - OAuthError::ClientRegistration(OAuthClientRegistrationError::NotSupported) - ) - }) { + if let Some(error) = error.downcast_ref::() + && let OAuthError::ClientRegistration(OAuthClientRegistrationError::NotSupported) = + error + { // This would require to register with the authorization server manually, which // we don't support here. bail!(