From 382916c3eeae3ed05f796d0255d3bf804a0b8a16 Mon Sep 17 00:00:00 2001 From: Alex Clarke Date: Mon, 13 Jul 2026 17:12:58 -0600 Subject: [PATCH] style: Removed redundant '&' from paths module function calls --- src/client/azure_openai.rs | 4 ++-- src/config/session.rs | 2 +- src/function/mod.rs | 8 ++++---- src/main.rs | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/client/azure_openai.rs b/src/client/azure_openai.rs index 367b0ea..3431d3f 100644 --- a/src/client/azure_openai.rs +++ b/src/client/azure_openai.rs @@ -50,7 +50,7 @@ fn prepare_chat_completions( let url = format!( "{}/openai/deployments/{}/chat/completions?api-version=2024-12-01-preview", - &api_base, + api_base, self_.model.real_name() ); @@ -69,7 +69,7 @@ fn prepare_embeddings(self_: &AzureOpenAIClient, data: &EmbeddingsData) -> Resul let url = format!( "{}/openai/deployments/{}/embeddings?api-version=2024-10-21", - &api_base, + api_base, self_.model.real_name() ); diff --git a/src/config/session.rs b/src/config/session.rs index d82898d..7e9c24f 100644 --- a/src/config/session.rs +++ b/src/config/session.rs @@ -261,7 +261,7 @@ impl Session { data["messages"] = json!(self.messages); let output = serde_yaml::to_string(&data) - .with_context(|| format!("Unable to show info about session '{}'", &self.name))?; + .with_context(|| format!("Unable to show info about session '{}'", self.name))?; Ok(output) } diff --git a/src/function/mod.rs b/src/function/mod.rs index 3d79356..dff3ded 100644 --- a/src/function/mod.rs +++ b/src/function/mod.rs @@ -147,10 +147,10 @@ pub async fn eval_tool_calls( let mut is_all_null = true; for call in calls { if let Some(msg) = ctx.tool_scope.tool_tracker.check_loop(&call.clone()) { - let dup_msg = format!("{{\"tool_call_loop_alert\":{}}}", &msg.trim()); + let dup_msg = format!("{{\"tool_call_loop_alert\":{}}}", msg.trim()); println!( "{}", - warning_text(format!("{}: ⚠️ Tool-call loop detected! ⚠️", &call.name).as_str()) + warning_text(format!("{}: ⚠️ Tool-call loop detected! ⚠️", call.name).as_str()) ); let val = json!(dup_msg); output.push(ToolResult::new(call, val)); @@ -870,7 +870,7 @@ impl Functions { let root_dir = paths::functions_dir(); let tool_path = format!( "{}/{binary_name}", - &paths::global_tools_dir().to_string_lossy() + paths::global_tools_dir().to_string_lossy() ); content_template .replace("{function_name}", binary_name) @@ -881,7 +881,7 @@ impl Functions { let root_dir = paths::agent_data_dir(agent_name); let tool_path = format!( "{}/{binary_name}", - &paths::global_tools_dir().to_string_lossy() + paths::global_tools_dir().to_string_lossy() ); content_template .replace("{function_name}", binary_name) diff --git a/src/main.rs b/src/main.rs index b4b652c..64cc0f3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -563,7 +563,7 @@ async fn shell_execute( match answer_char { 'e' => { - debug!("{} {:?}", shell.cmd, &[&shell.arg, &eval_str]); + debug!("{} {:?}", shell.cmd, [&shell.arg, &eval_str]); let code = run_command(&shell.cmd, &[&shell.arg, &eval_str], None)?; if code == 0 && app.save_shell_history { let _ = append_to_shell_history(&shell.name, &eval_str, code);