Skip to content

Commit 22fa0e1

Browse files
committed
fix: clippy cleanup
1 parent 29de071 commit 22fa0e1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

router/src/server.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,6 @@ pub(crate) async fn chat_completions(
12851285
}
12861286
};
12871287
let mut response_as_tool = using_tools;
1288-
let mut global_function_name = String::new();
12891288
while let Some(result) = response_stream.next().await {
12901289
match result{
12911290
Ok(stream_token) => {
@@ -1295,8 +1294,8 @@ pub(crate) async fn chat_completions(
12951294
json_buffer.push_str(&token_text.replace(" ", ""));
12961295
buffer.push(stream_token);
12971296
if let Some(captures) = function_regex.captures(&json_buffer) {
1298-
global_function_name = captures[1].to_string();
1299-
if global_function_name == "no_tool" {
1297+
let function_name = captures[1].to_string();
1298+
if function_name == "no_tool" {
13001299
state = StreamState::BufferTrailing;
13011300
response_as_tool = false;
13021301
buffer.clear();
@@ -1317,7 +1316,7 @@ pub(crate) async fn chat_completions(
13171316
id: String::new(),
13181317
r#type: "function".to_string(),
13191318
function: Function {
1320-
name: Some(global_function_name.clone()),
1319+
name: Some(function_name.clone()),
13211320
arguments: "".to_string(),
13221321
},
13231322
}],

0 commit comments

Comments
 (0)