Skip to content

Commit bb52874

Browse files
committed
Remove some boxes
1 parent 1e853bf commit bb52874

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

sdk/data_cosmos/src/operations/get_document.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,13 @@ impl std::future::IntoFuture for GetDocumentBuilder {
7474
}
7575

7676
#[derive(Debug, Clone)]
77+
// note(rylev): clippy seems to be falsely detecting that
78+
// one of the variants is much larger than the other (which
79+
// is not true)
80+
#[allow(clippy::large_enum_variant)]
7781
pub enum GetDocumentResponse<T> {
78-
Found(Box<FoundDocumentResponse<T>>),
79-
NotFound(Box<NotFoundDocumentResponse>),
82+
Found(FoundDocumentResponse<T>),
83+
NotFound(NotFoundDocumentResponse),
8084
}
8185

8286
impl<T> GetDocumentResponse<T>
@@ -92,13 +96,13 @@ where
9296
let body = collect_pinned_stream(pinned_stream).await?;
9397

9498
if has_been_found {
95-
Ok(GetDocumentResponse::Found(Box::new(
99+
Ok(GetDocumentResponse::Found(
96100
FoundDocumentResponse::try_from(&headers, body).await?,
97-
)))
101+
))
98102
} else {
99-
Ok(GetDocumentResponse::NotFound(Box::new(
103+
Ok(GetDocumentResponse::NotFound(
100104
NotFoundDocumentResponse::try_from(&headers).await?,
101-
)))
105+
))
102106
}
103107
}
104108
}

0 commit comments

Comments
 (0)