diff --git a/poem-grpc/src/status.rs b/poem-grpc/src/status.rs index e4119738bc..4c72499ff3 100644 --- a/poem-grpc/src/status.rs +++ b/poem-grpc/src/status.rs @@ -233,7 +233,7 @@ impl Code { pub struct Status { code: Code, message: Option, - metadata: Metadata, + metadata: Box, } impl Display for Status { @@ -300,7 +300,10 @@ impl Status { /// Attach a meta data to this status. #[inline] pub fn with_metadata(self, metadata: Metadata) -> Self { - Self { metadata, ..self } + Self { + metadata: Box::new(metadata), + ..self + } } /// Returns a reference to the metadata.