Skip to content

Commit 1140c0c

Browse files
fix: Use rfind instead of filter+next_back for clippy lint
1 parent e83e6f2 commit 1140c0c

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/openai_compat.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,7 @@ pub async fn chat_completions(
191191
let last_user_message = req
192192
.messages
193193
.iter()
194-
.filter(|m| m.role == "user")
195-
.next_back()
194+
.rfind(|m| m.role == "user")
196195
.map(|m| m.content.as_str());
197196

198197
// Build conversation history without the last user message

0 commit comments

Comments
 (0)