cargo clippy (#660)

This commit is contained in:
Adil Hafeez 2025-12-25 21:08:37 -08:00 committed by GitHub
parent c75e7606f9
commit ca95ffb63d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
62 changed files with 1864 additions and 1187 deletions

View file

@ -142,8 +142,7 @@ impl HttpContext for StreamContext {
let last_user_prompt = match deserialized_body
.messages
.iter()
.filter(|msg| msg.role == USER_ROLE)
.last()
.rfind(|msg| msg.role == USER_ROLE)
{
Some(content) => content,
None => {
@ -155,11 +154,8 @@ impl HttpContext for StreamContext {
self.user_prompt = Some(last_user_prompt.clone());
// convert prompt targets to ChatCompletionTool
let tool_calls: Vec<ChatCompletionTool> = self
.prompt_targets
.iter()
.map(|(_, pt)| pt.into())
.collect();
let tool_calls: Vec<ChatCompletionTool> =
self.prompt_targets.values().map(|pt| pt.into()).collect();
let mut metadata = deserialized_body.metadata.clone();