refactor: optimize string creation in get_current_platform function

This commit is contained in:
Kuingsmile
2025-07-14 21:51:45 +08:00
parent ffdf996cd0
commit 1d74daf8a5

View File

@@ -70,10 +70,10 @@ fn get_current_platform() -> String {
let os = env::consts::OS;
match os {
"windows" => format!("pc-windows-msvc"),
"macos" => format!("apple-darwin"),
"linux" => format!("unknown-linux-gnu"),
_ => format!("{os}"),
"windows" => "pc-windows-msvc".to_string(),
"macos" => "apple-darwin".to_string(),
"linux" => "unknown-linux-gnu".to_string(),
_ => os.to_string(),
}
}