Skip to content

Commit b7df6a4

Browse files
committed
Fix: address clippy errors
1 parent ba2813c commit b7df6a4

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎libs/opsqueue_python/src/producer.rs‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -428,10 +428,12 @@ impl ProducerClient {
428428
}
429429

430430
/// Stream output chunks as soon as each consumer has completed them.
431+
#[must_use]
431432
pub fn stream_submission_chunks(&self, submission_id: SubmissionId) -> PyChunksIter {
432433
self.streaming_submission_chunks(submission_id)
433434
}
434435

436+
#[allow(clippy::too_many_lines)]
435437
fn streaming_submission_chunks(&self, submission_id: SubmissionId) -> PyChunksIter {
436438
let client = self.client.clone();
437439
let object_store_client = self.object_store_client.clone();
@@ -527,9 +529,9 @@ impl ProducerClient {
527529
let failure =
528530
crate::common::ChunkFailed::from_internal(chunk, &submission);
529531
return Some((
530-
Err(StreamingChunkError::Failed(
532+
Err(StreamingChunkError::Failed(Box::new(
531533
crate::errors::SubmissionFailed(submission.into(), failure),
532-
)),
534+
))),
533535
(
534536
client,
535537
object_store_client,
@@ -733,7 +735,7 @@ impl ProducerClient {
733735
enum StreamingChunkError {
734736
Retrieval(ChunkRetrievalError),
735737
Internal(InternalProducerClientError),
736-
Failed(crate::errors::SubmissionFailed),
738+
Failed(Box<crate::errors::SubmissionFailed>),
737739
SubmissionNotFound,
738740
Cancelled,
739741
}
@@ -757,7 +759,7 @@ impl From<CError<StreamingChunkError>> for PyErr {
757759
match value.0 {
758760
StreamingChunkError::Retrieval(error) => CError(error).into(),
759761
StreamingChunkError::Internal(error) => CError(error).into(),
760-
StreamingChunkError::Failed(error) => CError(error).into(),
762+
StreamingChunkError::Failed(error) => CError(*error).into(),
761763
error => PyException::new_err(error.to_string()),
762764
}
763765
}

0 commit comments

Comments
 (0)