fix(api): return stream events directly from ingest_chunk

Resolves clippy::unnecessary_wraps on StreamState::ingest_chunk in openai_compat.rs.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-04-02 14:58:51 +09:00
parent 722eee3ea5
commit d9c1883879
@@ -261,7 +261,7 @@ impl MessageStream {
match self.response.chunk().await? {
Some(chunk) => {
for parsed in self.parser.push(&chunk)? {
self.pending.extend(self.state.ingest_chunk(parsed)?);
self.pending.extend(self.state.ingest_chunk(parsed));
}
}
None => {
@@ -330,7 +330,7 @@ impl StreamState {
}
}
fn ingest_chunk(&mut self, chunk: ChatCompletionChunk) -> Result<Vec<StreamEvent>, ApiError> {
fn ingest_chunk(&mut self, chunk: ChatCompletionChunk) -> Vec<StreamEvent> {
let mut events = Vec::new();
if !self.message.started {
self.message.started = true;
@@ -418,7 +418,7 @@ impl StreamState {
}
}
Ok(events)
events
}
fn finish(&mut self) -> Result<Vec<StreamEvent>, ApiError> {