Refactor string handling to use into() instead of to_string() for improved performance and consistency across the codebase. This change affects various modules including app.rs, clash.rs, config.rs, core.rs, service.rs, and others, ensuring that string conversions are streamlined and more idiomatic.

This commit is contained in:
Tunglies
2025-10-14 09:24:39 +08:00
parent 44eb781060
commit 924e7d1022
22 changed files with 167 additions and 161 deletions

View File

@@ -86,7 +86,7 @@ impl WebDavClient {
|| verge.webdav_username.is_none()
|| verge.webdav_password.is_none()
{
let msg = "Unable to create web dav client, please make sure the webdav config is correct".to_string();
let msg: String = "Unable to create web dav client, please make sure the webdav config is correct".into();
return Err(anyhow::Error::msg(msg));
}
@@ -95,7 +95,7 @@ impl WebDavClient {
.webdav_url
.unwrap_or_default()
.trim_end_matches('/')
.to_string(),
.into(),
username: verge.webdav_username.unwrap_or_default(),
password: verge.webdav_password.unwrap_or_default(),
};