From ae7d477d54b91db3ca8c8c00863756085b01fd87 Mon Sep 17 00:00:00 2001 From: Adrian Kumpf <8999358+adriankumpf@users.noreply.github.com> Date: Wed, 25 Feb 2026 14:45:58 +0100 Subject: [PATCH] Use as_str() instead of to_string() --- src/auth.rs | 2 +- src/main.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/auth.rs b/src/auth.rs index 5969d4a..baa38f9 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -22,7 +22,7 @@ const TOKEN_URL_CN: &str = "https://auth.tesla.cn/oauth2/v3/token"; const REDIRECT_URL: &str = "https://auth.tesla.com/void/callback"; pub fn is_redirect_url(url: &Url) -> bool { - url.to_string().starts_with(REDIRECT_URL) + url.as_str().starts_with(REDIRECT_URL) } #[derive(Debug, Clone)] diff --git a/src/main.rs b/src/main.rs index f76d383..eeb09b1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -163,7 +163,7 @@ fn main() -> anyhow::Result<()> { } => *control_flow = ControlFlow::Exit, Event::UserEvent(UserEvent::Navigation(url)) => { - if url.to_string() != "about:blank" { + if url.as_str() != "about:blank" { log::debug!("URL changed: {url}"); let _ = tx.send(url); }