From 51e44cdca2e32ddb018cf6dff086aba007421fa6 Mon Sep 17 00:00:00 2001 From: Chrislearn Young Date: Thu, 4 Jul 2024 17:04:00 +0800 Subject: [PATCH] use Into to set response body (#828) --- crates/core/src/http/response.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/core/src/http/response.rs b/crates/core/src/http/response.rs index 82a313497..798cad08b 100644 --- a/crates/core/src/http/response.rs +++ b/crates/core/src/http/response.rs @@ -177,8 +177,8 @@ impl Response { } /// Sets body. #[inline] - pub fn body(&mut self, body: ResBody) -> &mut Self { - self.body = body; + pub fn body(&mut self, body: impl Into) -> &mut Self { + self.body = body.into(); self }