Skip to content

Commit 997efdd

Browse files
committed
refactor: use String::new() for empty API key
Use `String::new()` instead of `“”.to_string()` when no API key is supplied. This eliminates an unnecessary heap allocation and clarifies that the intent is to create an empty string without creating a temporary literal.
1 parent b823739 commit 997efdd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src-tauri/plugins/tauri-plugin-llamacpp/src/commands.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ pub async fn load_llama_model<R: Runtime>(
9292
.map(|s| s.to_string())
9393
.unwrap_or_else(|| {
9494
log::warn!("API key not provided");
95-
"".to_string()
95+
String::new()
9696
});
9797

9898
// Configure the command to run the server

0 commit comments

Comments
 (0)