mirror of
https://github.com/adriankumpf/tesla_auth.git
synced 2026-02-27 09:54:03 +08:00
Use as_str() instead of to_string()
This commit is contained in:
+1
-1
@@ -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)]
|
||||
|
||||
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user