Skip to content

Commit cccd1cc

Browse files
committed
refactor: optimize string collection in transforms_json function
1 parent b814899 commit cccd1cc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/middleware/claude/claude2oai.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ pub fn transforms_json(input: CreateMessageResponse) -> Value {
104104
crate::types::claude::ContentBlock::Text { text } => Some(text.clone()),
105105
_ => None,
106106
})
107-
.collect::<Vec<_>>()
108-
.join("");
107+
.collect::<String>();
109108

110109
let usage = input.usage.as_ref().map(|u| {
111110
serde_json::json!({

0 commit comments

Comments
 (0)