From f2c5d374f346725e7bd796f85591f39fd288db4c Mon Sep 17 00:00:00 2001 From: hzlinyiyu Date: Sat, 14 Sep 2024 12:30:34 +0800 Subject: [PATCH 1/2] chore: fix clippy --- poem-grpc/src/status.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/poem-grpc/src/status.rs b/poem-grpc/src/status.rs index e4119738bc..1ebb964caf 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,7 @@ 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. From 9e461feec923c84b47da0b246889a3ea143bbc26 Mon Sep 17 00:00:00 2001 From: hzlinyiyu Date: Sat, 14 Sep 2024 13:44:17 +0800 Subject: [PATCH 2/2] fmt --- poem-grpc/src/status.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/poem-grpc/src/status.rs b/poem-grpc/src/status.rs index 1ebb964caf..4c72499ff3 100644 --- a/poem-grpc/src/status.rs +++ b/poem-grpc/src/status.rs @@ -300,7 +300,10 @@ impl Status { /// Attach a meta data to this status. #[inline] pub fn with_metadata(self, metadata: Metadata) -> Self { - Self { metadata: Box::new(metadata), ..self } + Self { + metadata: Box::new(metadata), + ..self + } } /// Returns a reference to the metadata.