From 000559bc9d77accfde65cb58828f7ddbe199db5b Mon Sep 17 00:00:00 2001 From: Alex Clarke Date: Tue, 21 Jul 2026 11:24:18 -0600 Subject: [PATCH] style: Applied formatting --- src/client/oauth.rs | 9 +++------ src/client/openai_compatible_oauth.rs | 4 +++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/client/oauth.rs b/src/client/oauth.rs index c31fc72..ae4cc44 100644 --- a/src/client/oauth.rs +++ b/src/client/oauth.rs @@ -684,8 +684,8 @@ fn parse_paste_input(input: &str) -> Result<(String, Option)> { } if input.starts_with("http://") || input.starts_with("https://") { - let parsed = Url::parse(input) - .with_context(|| format!("Failed to parse pasted URL: {input}"))?; + let parsed = + Url::parse(input).with_context(|| format!("Failed to parse pasted URL: {input}"))?; let code = parsed .query_pairs() .find(|(k, _)| k == "code") @@ -1294,10 +1294,7 @@ echo_pkce_in_token_exchange: true fn parse_paste_input_url_missing_code_fails() { let err = parse_paste_input("https://provider.example/oauth/callback?state=xyz").unwrap_err(); - assert!( - err.to_string().contains("code"), - "unexpected error: {err}" - ); + assert!(err.to_string().contains("code"), "unexpected error: {err}"); } #[test] diff --git a/src/client/openai_compatible_oauth.rs b/src/client/openai_compatible_oauth.rs index 5a57be9..729ca2c 100644 --- a/src/client/openai_compatible_oauth.rs +++ b/src/client/openai_compatible_oauth.rs @@ -1,3 +1,5 @@ +use url::Url; + use super::oauth::{OAuthConfig, OAuthFlow, OAuthProvider, TokenRequestFormat}; pub struct OpenAICompatibleOAuthProvider { @@ -6,7 +8,7 @@ pub struct OpenAICompatibleOAuthProvider { } fn is_loopback_uri(uri: &str) -> bool { - url::Url::parse(uri) + Url::parse(uri) .ok() .and_then(|u| u.host_str().map(str::to_string)) .is_some_and(|host| matches!(host.as_str(), "127.0.0.1" | "localhost" | "[::1]" | "::1"))