mirror of
https://github.com/ultraworkers/claw-code-parity.git
synced 2026-04-23 21:26:03 +02:00
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:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user